/** * Prepares the message endpoint, and automatically activates it * if the "autoStartup" flag is set to "true". */ @Override public void afterPropertiesSet() throws ResourceException { if (getResourceAdapter() == null) { throw new IllegalArgumentException("Property 'resourceAdapter' is required"); } if (getMessageEndpointFactory() == null) { throw new IllegalArgumentException("Property 'messageEndpointFactory' is required"); } ActivationSpec activationSpec = getActivationSpec(); if (activationSpec == null) { throw new IllegalArgumentException("Property 'activationSpec' is required"); } if (activationSpec.getResourceAdapter() == null) { activationSpec.setResourceAdapter(getResourceAdapter()); } else if (activationSpec.getResourceAdapter() != getResourceAdapter()) { throw new IllegalArgumentException("ActivationSpec [" + activationSpec + "] is associated with a different ResourceAdapter: " + activationSpec.getResourceAdapter()); } }
/** * Prepares the message endpoint, and automatically activates it * if the "autoStartup" flag is set to "true". */ @Override public void afterPropertiesSet() throws ResourceException { if (getResourceAdapter() == null) { throw new IllegalArgumentException("Property 'resourceAdapter' is required"); } if (getMessageEndpointFactory() == null) { throw new IllegalArgumentException("Property 'messageEndpointFactory' is required"); } ActivationSpec activationSpec = getActivationSpec(); if (activationSpec == null) { throw new IllegalArgumentException("Property 'activationSpec' is required"); } if (activationSpec.getResourceAdapter() == null) { activationSpec.setResourceAdapter(getResourceAdapter()); } else if (activationSpec.getResourceAdapter() != getResourceAdapter()) { throw new IllegalArgumentException("ActivationSpec [" + activationSpec + "] is associated with a different ResourceAdapter: " + activationSpec.getResourceAdapter()); } }
protected void endpointActivation(MessageEndpointFactory messageEndpointFactory, ActivationSpec activationSpec) throws MBeanException { boolean trace = log.isTraceEnabled(); if (trace) log.trace("EndpointActivation rar=" + getServiceName() + " messagingEndpointFactory=" + messageEndpointFactory + " activationSpec=" + activationSpec); try { activationSpec.setResourceAdapter(resourceAdapter); resourceAdapter.endpointActivation(messageEndpointFactory, activationSpec); } catch (Exception e) { throw new MBeanException(e, "Error in endpoint activation " + getServiceName()); } }
activationSpec.setResourceAdapter(resourceAdapter);
activationSpec.setResourceAdapter(resourceAdapter);
/** * Prepares the message endpoint, and automatically activates it * if the "autoStartup" flag is set to "true". */ @Override public void afterPropertiesSet() throws ResourceException { if (getResourceAdapter() == null) { throw new IllegalArgumentException("Property 'resourceAdapter' is required"); } if (getMessageEndpointFactory() == null) { throw new IllegalArgumentException("Property 'messageEndpointFactory' is required"); } ActivationSpec activationSpec = getActivationSpec(); if (activationSpec == null) { throw new IllegalArgumentException("Property 'activationSpec' is required"); } if (activationSpec.getResourceAdapter() == null) { activationSpec.setResourceAdapter(getResourceAdapter()); } else if (activationSpec.getResourceAdapter() != getResourceAdapter()) { throw new IllegalArgumentException("ActivationSpec [" + activationSpec + "] is associated with a different ResourceAdapter: " + activationSpec.getResourceAdapter()); } }
activationSpec.setResourceAdapter(resourceAdapter);
activationSpec.setResourceAdapter(resourceAdapter);
/** * Prepares the message endpoint, and automatically activates it * if the "autoStartup" flag is set to "true". */ @Override public void afterPropertiesSet() throws ResourceException { if (getResourceAdapter() == null) { throw new IllegalArgumentException("Property 'resourceAdapter' is required"); } if (getMessageEndpointFactory() == null) { throw new IllegalArgumentException("Property 'messageEndpointFactory' is required"); } ActivationSpec activationSpec = getActivationSpec(); if (activationSpec == null) { throw new IllegalArgumentException("Property 'activationSpec' is required"); } if (activationSpec.getResourceAdapter() == null) { activationSpec.setResourceAdapter(getResourceAdapter()); } else if (activationSpec.getResourceAdapter() != getResourceAdapter()) { throw new IllegalArgumentException("ActivationSpec [" + activationSpec + "] is associated with a different ResourceAdapter: " + activationSpec.getResourceAdapter()); } }
msgListenerType), false, resourceAdapter.getClass().getClassLoader()).newInstance()); aspec.setResourceAdapter(resourceAdapter);
public void start() throws Exception { if (resourceAdapter == null && jcaContainer != null) { resourceAdapter = jcaContainer.getResourceAdapter(); } if (resourceAdapter == null) { throw new IllegalArgumentException("resourceAdapter property must be set on the activationSpec object"); } if (activationSpec.getResourceAdapter() == null) { activationSpec.setResourceAdapter(resourceAdapter); } if (bootstrapContext == null && jcaContainer != null) { bootstrapContext = jcaContainer.getBootstrapContext(); } if (bootstrapContext == null) { throw new IllegalArgumentException("bootstrapContext must be set"); } if (endpointFactory == null) { if (ref == null) { throw new IllegalArgumentException("either the endpointFactory or ref properties must be set"); } DefaultEndpointFactory defaultEF = new DefaultEndpointFactory(beanFactory, ref); defaultEF.setAcknowledgeType(acknowledgeType); defaultEF.setTransactionManager(transactionManager); defaultEF.setName(name); this.endpointFactory = defaultEF; } log.info("Activating endpoint for activationSpec: " + activationSpec + " using endpointFactory: " + endpointFactory); resourceAdapter.endpointActivation(endpointFactory, activationSpec); }
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.setResourceAdapter(ra);
activationSpec.setResourceAdapter(_ra);
activationSpec.setResourceAdapter(_ra);
activationSpec.setResourceAdapter(this.joramAdapter); } catch (ResourceException e) { throw new EZBComponentException("Cannot set resource adapter on activation spec object", e);
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(); }