/** * Stops the ResourceAdapter. * @see javax.resource.spi.ResourceAdapter#stop() */ @Override public void destroy() { if (this.resourceAdapter != null) { this.resourceAdapter.stop(); } }
/** * Activates the configured message endpoint. */ @Override public void start() { synchronized (this.lifecycleMonitor) { if (!this.running) { ResourceAdapter resourceAdapter = getResourceAdapter(); Assert.state(resourceAdapter != null, "No ResourceAdapter set"); try { resourceAdapter.endpointActivation(getMessageEndpointFactory(), getActivationSpec()); } catch (ResourceException ex) { throw new IllegalStateException("Could not activate message endpoint", ex); } this.running = true; } } }
/** * Deactivates the configured message endpoint. */ @Override public void stop() { synchronized (this.lifecycleMonitor) { if (this.running) { ResourceAdapter resourceAdapter = getResourceAdapter(); Assert.state(resourceAdapter != null, "No ResourceAdapter set"); resourceAdapter.endpointDeactivation(getMessageEndpointFactory(), getActivationSpec()); this.running = false; } } }
/** * Builds the BootstrapContext and starts the ResourceAdapter with it. * @see javax.resource.spi.ResourceAdapter#start(javax.resource.spi.BootstrapContext) */ @Override public void afterPropertiesSet() throws ResourceException { if (this.resourceAdapter == null) { throw new IllegalArgumentException("'resourceAdapter' or 'resourceAdapterClass' is required"); } if (this.bootstrapContext == null) { this.bootstrapContext = new SimpleBootstrapContext(this.workManager, this.xaTerminator); } this.resourceAdapter.start(this.bootstrapContext); }
public synchronized void stop() throws Exception { resourceAdapter.endpointDeactivation(endpointFactory, activationSpec); resourceAdapter.stop(); super.stop(); }
public void start() throws Exception { transactionManager = (TransactionManager) context.getTransactionManager(); endpointFactory = new SingletonEndpointFactory(this, transactionManager); bootstrapContext = endpoint.getBootstrapContext(); if (bootstrapContext == null) { throw new IllegalArgumentException("bootstrapContext not set"); } connectionFactory = endpoint.getConnectionFactory(); if (connectionFactory == null) { throw new IllegalArgumentException("connectionFactory not set"); } activationSpec = endpoint.getActivationSpec(); if (activationSpec == null) { throw new IllegalArgumentException("activationSpec not set"); } resourceAdapter = endpoint.getResourceAdapter(); if (resourceAdapter == null) { resourceAdapter = activationSpec.getResourceAdapter(); if (resourceAdapter == null) { throw new IllegalArgumentException("resourceAdapter not set"); } } else if (activationSpec.getResourceAdapter() == null) { activationSpec.setResourceAdapter(resourceAdapter); } resourceAdapter.start(bootstrapContext); resourceAdapter.endpointActivation(endpointFactory, activationSpec); }
ActivationSpec [] asArray = new ActivationSpec[1]; asArray[0] = as; XAResource [] xar = rar.getResourceAdapter().getXAResources(asArray); if (xar != null && xar.length > 0) { Current.getTransactionRecovery(). rar.getResourceAdapter().endpointActivation(this, as); } catch (Exception ex) { activated = false;
public XAResource[] getXAResources(ActivationSpec[] specs) throws ResourceException { return resourceAdapter.getXAResources(specs); }
/** * Builds the BootstrapContext and starts the ResourceAdapter with it. * @see javax.resource.spi.ResourceAdapter#start(javax.resource.spi.BootstrapContext) */ @Override public void afterPropertiesSet() throws ResourceException { if (this.resourceAdapter == null) { throw new IllegalArgumentException("'resourceAdapter' or 'resourceAdapterClass' is required"); } if (this.bootstrapContext == null) { this.bootstrapContext = new SimpleBootstrapContext(this.workManager, this.xaTerminator); } this.resourceAdapter.start(this.bootstrapContext); }
public synchronized void start() throws Exception { if (bootstrapContext == null) { Executor executor = getServiceUnit().getComponent().getExecutor(MessageExchange.Role.CONSUMER); WorkManager wm = new WorkManagerWrapper(executor); bootstrapContext = new SimpleBootstrapContext(wm); } resourceAdapter.start(bootstrapContext); activationSpec.setResourceAdapter(resourceAdapter); if (endpointFactory == null) { TransactionManager tm = (TransactionManager) getContext().getTransactionManager(); endpointFactory = new SingletonEndpointFactory(new MessageListener() { public void onMessage(Message message) { try { JmsJcaConsumerEndpoint.this.onMessage(message, null); } catch (JMSException e) { throw new ListenerExecutionFailedException("Unable to handle message", e); } } }, tm); } resourceAdapter.endpointActivation(endpointFactory, activationSpec); super.start(); }
/** * {@inheritDoc} */ @Override public XAResource[] getXAResources() { try { XAResource[] result = resourceAdapter.getXAResources(new ActivationSpec[] {activationSpec}); if (result == null || result.length == 0) return result; XAResource[] newResult = new XAResource[result.length]; for (int i = 0; i < result.length; i++) { newResult[i] = new XAResourceWrapperImpl(result[i], productName, productVersion); } return newResult; } catch (NotSupportedException nse) { // Ignore } catch (ResourceException re) { log.exceptionDuringCrashRecoveryInflow(resourceAdapter.getClass().getName(), activationSpec, re); } return new XAResource[0]; }
/** * Stops the ResourceAdapter. * @see javax.resource.spi.ResourceAdapter#stop() */ @Override public void destroy() { if (this.resourceAdapter != null) { this.resourceAdapter.stop(); } }
/** * Deactivates the configured message endpoint. */ @Override public void stop() { synchronized (this.lifecycleMonitor) { if (this.running) { ResourceAdapter resourceAdapter = getResourceAdapter(); Assert.state(resourceAdapter != null, "No ResourceAdapter set"); resourceAdapter.endpointDeactivation(getMessageEndpointFactory(), getActivationSpec()); this.running = false; } } }
/** * Activates the configured message endpoint. */ @Override public void start() { synchronized (this.lifecycleMonitor) { if (!this.running) { ResourceAdapter resourceAdapter = getResourceAdapter(); Assert.state(resourceAdapter != null, "No ResourceAdapter set"); try { resourceAdapter.endpointActivation(getMessageEndpointFactory(), getActivationSpec()); } catch (ResourceException ex) { throw new IllegalStateException("Could not activate message endpoint", ex); } this.running = true; } } }
/** * called by connector runtime to start the resource-adapter java bean * @param bootstrapContext BootstrapContext * @throws ResourceAdapterInternalException */ protected void startResourceAdapter(BootstrapContext bootstrapContext) throws ResourceAdapterInternalException { resourceadapter_.start(bootstrapContext); }
public NamedXAResource getNamedXAResource() throws SystemException { try { XAResource[] xaResources = resourceAdapter.getXAResources(new ActivationSpec[]{activationSpec}); if (xaResources == null || xaResources.length == 0 || xaResources[0] == null) { return null; } return new WrapperNamedXAResource(xaResources[0], name); } catch (ResourceException e) { throw (SystemException) new SystemException("Could not get XAResource for recovery for mdb: " + name).initCause(e); } }
deploymentMD.getResourceAdapter().stop();
/** * Cleans up the entity server nicely. */ @Override public void destroy() { _ra.endpointDeactivation(this, _activationSpec); }
public void endpointActivation(final MessageEndpointFactory messageEndpointFactory, final ActivationSpec activationSpec) throws ResourceException { resourceAdapter.endpointActivation(messageEndpointFactory, activationSpec); }
/** * Adds a resource to the resource manager. */ private void addResourceImpl(ResourceAdapter resource) { try { resource.start(this); } catch (Exception e) { log.log(Level.WARNING, e.toString(), e); } _resources.add(resource); }