[TOC]
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.
@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> |
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.
/** | |
* 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 |
public class EventFiringBean { | |
@Inject @Outbound @Default Event<String> stringJmsEvent; | |
@Inject Event<String> stringEvent; | |
} |
public class EventFiringBean { | |
@Inject @Outbound Event<String> stringJmsEvent; | |
@Inject Event<String> stringEvent; | |
} |
public class EventFiringBean { | |
@Inject @Outbound Event<String> stringJmsEvent; | |
@Inject Event<String> stringEvent; | |
} |
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); | |
} | |
} |