Skip to content

Instantly share code, notes, and snippets.

@pmuir
pmuir / gist:579315
Created September 14, 2010 16:35 — forked from tsurdilo/gist:579313
@RunWith(Arquillian.class)
public class KSessionTest
{
@Deployment
public static JavaArchive createTestArchive()
{
String pkgPath = KSessionTest.class.getPackage().getName().replaceAll("\\.", "/");
JavaArchive archive = ShrinkWrap.create("test.jar", JavaArchive.class)
.addPackages(true, new DroolsModuleFilter("ksession"), KnowledgeBaseProducer.class.getPackage())
.addClass(KSessionTestRules.class)
@pmuir
pmuir / Config.java
Created September 14, 2010 17:19 — forked from tsurdilo/gist:579321
@Drools(kbuilderConfigFile = "kbuilderconfig.properties",
kbaseConfigFile = "kbaseconfig.properties",
})
@Produces
@ApplicationScoped
RuleResouces configureRules() {
// Here the RuleResource guesses at being a DRL based on extension (not sure if this is valid)
// I also compressed the URL back to a normal syntax
return new RuleResources().add(new RuleResource("classpath:/kbasetest.drl", "forkbasetest")).add(...);
}
// 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);
}
}
@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;
}
@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: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:50 — forked from johnament/EventFiringBean.java
CDI Event Qualifiers
public class EventFiringBean {
@Inject @Outbound @Default Event<String> stringJmsEvent;
@Inject Event<String> stringEvent;
}
@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 / 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 / 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.