Skip to content

Instantly share code, notes, and snippets.

@ApplicationScoped
public class CountryService {
private @Inject Cache<String, Country> cache;
private @Inject Self<CountryService> self;
public Country getByIsoA3(String isoA3) {
Country ctry = cache.get(isoA3);
if (ctry == null) {
<size-rotating-file-handler name="FILE">
<rotate-size>5MB</rotate-size>
<formatter>
<pattern-formatter
pattern="%d{yyyy/MM/dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n" />
</formatter>
<file relative-to="jboss.server.log.dir" path="server.log" />
<append value="true" />
</periodic-rotating-file-handler>
@pmuir
pmuir / README.md
Created February 29, 2012 15:54 — forked from sgilda/README.md

JBoss AS Quickstarts

[TOC]

Introduction

The quickstarts included in this distribution were written to demonstrate Java EE 6 and a few additional technologies. They provide small, specific, working examples that can used as a reference for your own project.

@pmuir
pmuir / README.md
Created February 29, 2012 13:44 — forked from sgilda/README.md

JBoss AS Quickstarts

The quickstarts included in this distribution were written to demonstrate Java EE 6 and a few additional technologies. They provide small, specific, working examples that can used as a reference for your own project.

These quickstarts will run in both the JBoss AS 7 or the JBoss Enterprise Application Platform 6 environments. If you want to run the quickstarts in JBoss Enterprise Application Platform 6, we recommend using the JBoss Enterprise Application Platform zip file. This version uses the correct dependencies and ensures you test and compile against your runtime environment.

@pmuir
pmuir / ApplicationConsumer.java
Created September 19, 2011 12:48 — forked from johnament/ApplicationConsumer.java
Resource Producer proposal for JMS 2.0
/**
* PLM: ApplicationConsumer is a class provided by the application, and injects and
* uses the resources defined in the central Resources class. An application would
* typically have multiple ApplicationConsumer-style classes - this is just an
* example
*/
public class ApplicationConsumer {
// regular destination.
@Inject @Foo
@pmuir
pmuir / EventFiringBean.java
Created June 7, 2011 12:50 — forked from johnament/EventFiringBean.java
CDI Event Qualifiers
public class EventFiringBean {
@Inject @Outbound @Default Event<String> stringJmsEvent;
@Inject Event<String> stringEvent;
}
@pmuir
pmuir / EventFiringBean.java
Created June 7, 2011 12:50 — forked from johnament/EventFiringBean.java
CDI Event Qualifiers
public class EventFiringBean {
@Inject @Outbound Event<String> stringJmsEvent;
@Inject Event<String> stringEvent;
}
@pmuir
pmuir / EventFiringBean.java
Created June 7, 2011 12:38 — forked from johnament/EventFiringBean.java
CDI Event Qualifiers
public class EventFiringBean {
@Inject @Outbound Event<String> stringJmsEvent;
@Inject Event<String> stringEvent;
}
@pmuir
pmuir / EventFiringBean.java
Created June 7, 2011 12:29 — forked from johnament/EventFiringBean.java
CDI Event Qualifiers
public class EventFiringBean {
@Inject @Outbound Event<String> stringJmsEvent;
@Inject Event<String> stringEvent;
}
// uncomment line if you want the instance to be retained in application scope
// @ApplicationScoped
public class ApplicationInitializer
{
public void onStartup(@Observes @Initialized Object ctx)
{
System.out.println("Initialized application with context" + ctx);
}
}