ResourceAdapter adapter = connector.setResourceAdapter(new ResourceAdapter(EmailResourceAdapter.class));
InboundResource inbound = adapter.setInboundResourceAdapter(new InboundResource());
MessageAdapter messageAdapter = inbound.setMessageAdapter(new MessageAdapter());
MessageListener listener = messageAdapter.addMessageListener(new MessageListener(EmailConsumer.class, EmailAccountInfo.class));
listener.getActivationSpec().addRequiredConfigProperty("address");
app.getResourceModules().add(new ConnectorModule(connector));
EjbJar ejbJar = new EjbJar();
ejbJar.addEnterpriseBean(new MessageDrivenBean(EmailBean.class));
app.getEjbModules().add(new EjbModule(ejbJar));