/** * {@inheritDoc} * @see DeployableContainer#deploy(Descriptor) */ @Override public void deploy(Descriptor descriptor) throws DeploymentException { if (descriptor == null) throw new DeploymentException("Could not deploy a null descriptor"); try { embedded.deploy(descriptor); } catch (Throwable t) { throw new DeploymentException("Could not undeploy the application: " + t.getMessage(), t); } }
/** * Set auto activate * @param v The value */ void setAutoActivate(boolean v) { try { RAActivator activator = embedded.lookup("RAActivator", RAActivator.class); if (activator != null) { activator.setEnabled(v); } } catch (Throwable t) { // Nothing } }
/** * {@inheritDoc} * @see org.jboss.arquillian.spi.DeployableContainer#stop */ @Override public void stop() throws LifecycleException { try { embedded.shutdown(); } catch (Throwable t) { throw new LifecycleException("Could not stop the IronJacamar container: " + t.getMessage(), t); } embedded = null; }
/** * {@inheritDoc} * @see DeployableContainer#undeploy(Descriptor) */ @Override public void undeploy(Descriptor descriptor) throws DeploymentException { if (descriptor == null) throw new DeploymentException("Could not undeploy a null application"); try { embedded.undeploy(descriptor); } catch (Throwable t) { throw new DeploymentException("Could not undeploy the application: " + t.getMessage(), t); } }
/** * {@inheritDoc} * @see org.jboss.arquillian.spi.DeployableContainer#start */ @Override public void start() throws LifecycleException { embedded = EmbeddedFactory.create(true); try { embedded.startup(); contextProducer.set(createContext()); embeddedProducer.set(embedded); } catch (Throwable t) { throw new LifecycleException("Could not start the IronJacamar container: " + t.getMessage(), t); } }
/** * {@inheritDoc} * @see DeployableContainer#undeploy(Descriptor) */ @Override public void undeploy(Descriptor descriptor) throws DeploymentException { if (descriptor == null) throw new DeploymentException("Could not undeploy a null application"); try { embedded.undeploy(descriptor); } catch (Throwable t) { throw new DeploymentException("Could not undeploy the application: " + t.getMessage(), t); } }
/** * {@inheritDoc} * @see org.jboss.arquillian.spi.DeployableContainer#start */ @Override public void start() throws LifecycleException { embedded = EmbeddedFactory.create(true); try { embedded.startup(); contextProducer.set(createContext()); embeddedProducer.set(embedded); } catch (Throwable t) { throw new LifecycleException("Could not start the EmbeddedJCA container: " + t.getMessage(), t); } }
/** * {@inheritDoc} * @see DeployableContainer#undeploy(Descriptor) */ @Override public void undeploy(Descriptor descriptor) throws DeploymentException { if (descriptor == null) throw new DeploymentException("Could not undeploy a null application"); try { embedded.undeploy(descriptor); } catch (Throwable t) { throw new DeploymentException("Could not undeploy the application: " + t.getMessage(), t); } }
/** * {@inheritDoc} * @see DeployableContainer#deploy(Descriptor) */ @Override public void deploy(Descriptor descriptor) throws DeploymentException { if (descriptor == null) throw new DeploymentException("Could not deploy a null descriptor"); try { embedded.deploy(descriptor); } catch (Throwable t) { throw new DeploymentException("Could not deploy the application: " + t.getMessage(), t); } }
/** * Set auto activate * @param v The value */ void setAutoActivate(boolean v) { try { RAActivator activator = embedded.lookup("RAActivator", RAActivator.class); if (activator != null) { activator.setEnabled(v); } } catch (Throwable t) { // Nothing } }
/** * {@inheritDoc} * @see org.jboss.arquillian.spi.DeployableContainer#stop */ @Override public void stop() throws LifecycleException { try { embedded.shutdown(); } catch (Throwable t) { throw new LifecycleException("Could not stop the IronJacamar container: " + t.getMessage(), t); } embedded = null; }
/** * {@inheritDoc} * @see org.jboss.arquillian.spi.DeployableContainer#start */ @Override public void start() throws LifecycleException { embedded = EmbeddedFactory.create(true); try { embedded.startup(); contextProducer.set(createContext()); embeddedProducer.set(embedded); } catch (Throwable t) { throw new LifecycleException("Could not start the IronJacamar container: " + t.getMessage(), t); } }
/** * {@inheritDoc} * @see DeployableContainer#undeploy(Archive) */ @Override public void undeploy(final Archive<?> archive) throws DeploymentException { if (archive == null) throw new DeploymentException("Could not undeploy a null application"); if (!(ResourceAdapterArchive.class.isInstance(archive))) throw new DeploymentException("Could not undeploy a non resource adapter application"); try { embedded.undeploy(ResourceAdapterArchive.class.cast(archive)); } catch (Throwable t) { throw new DeploymentException("Could not undeploy the application: " + t.getMessage(), t); } }
/** * {@inheritDoc} * @see DeployableContainer#deploy(Descriptor) */ @Override public void deploy(Descriptor descriptor) throws DeploymentException { if (descriptor == null) throw new DeploymentException("Could not deploy a null descriptor"); try { embedded.deploy(descriptor); } catch (Throwable t) { throw new DeploymentException("Could not deploy the application: " + t.getMessage(), t); } }
@SuppressWarnings("unchecked") private Object resolveResource(Field field, org.jboss.jca.arquillian.embedded.Inject annotation) { try { return embeddedInst.get().lookup(annotation.name(), field.getType()); } catch (Throwable t) { throw new RuntimeException("Could not inject: " + annotation.name() + " (" + field.getType() + ")", t); } } }
/** * {@inheritDoc} * @see org.jboss.arquillian.spi.DeployableContainer#stop */ @Override public void stop() throws LifecycleException { try { embedded.shutdown(); } catch (Throwable t) { throw new LifecycleException("Could not stop the EmbeddedJCA container: " + t.getMessage(), t); } embedded = null; }
/** * {@inheritDoc} * @see DeployableContainer#undeploy(Archive) */ @Override public void undeploy(final Archive<?> archive) throws DeploymentException { if (archive == null) throw new DeploymentException("Could not undeploy a null application"); if (!(ResourceAdapterArchive.class.isInstance(archive))) throw new DeploymentException("Could not undeploy a non resource adapter application"); try { embedded.undeploy(ResourceAdapterArchive.class.cast(archive)); } catch (Throwable t) { throw new DeploymentException("Could not undeploy the application: " + t.getMessage(), t); } }
/** * {@inheritDoc} * @see DeployableContainer#deploy(Archive) */ @Override public ProtocolMetaData deploy(final Archive<?> archive) throws DeploymentException { if (archive == null) throw new DeploymentException("Could not deploy a null application"); if (!(ResourceAdapterArchive.class.isInstance(archive))) throw new DeploymentException("Could not deploy a non resource adapter application"); try { embedded.deploy(ResourceAdapterArchive.class.cast(archive)); } catch (Throwable t) { throw new DeploymentException("Could not deploy the application: " + t.getMessage(), t); } // Invoke locally return new ProtocolMetaData(); }
@SuppressWarnings("unchecked") private Object resolveResource(Field field, org.jboss.jca.embedded.arquillian.Inject annotation) { try { return embeddedInst.get().lookup(annotation.name(), field.getType()); } catch (Throwable t) { // Nothing to do } return null; } }
/** * {@inheritDoc} * @see DeployableContainer#undeploy(Archive) */ @Override public void undeploy(final Archive<?> archive) throws DeploymentException { if (archive == null) throw new DeploymentException("Could not undeploy a null application"); if (!(ResourceAdapterArchive.class.isInstance(archive))) throw new DeploymentException("Could not undeploy a non resource adapter application"); try { embedded.undeploy(ResourceAdapterArchive.class.cast(archive)); } catch (Throwable t) { throw new DeploymentException("Could not undeploy the application: " + t.getMessage(), t); } }