/** * 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.validate(); } catch (UnsupportedOperationException uoe) { logger.info("ActivationSpec does not support validate. Implementation of validate is optional"); activationSpec.setResourceAdapter(resourceAdapter);
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()); } }
/** * Validate an ActivationSpec instance on the first usage. * * @param spec The spec instance to validate. */ private void checkConstraints(ActivationSpec spec) throws InvalidPropertyException { if (!validated) { // There are two potential validations, self validation via the // validate() method and container-driven validation using bean validation. try { spec.validate(); } catch (UnsupportedOperationException uoe) { // ignore if not implemented. } // if we have a validator factory at this point, then validate // the resource adaptor instance if (validatorFactory != null) { Validator validator = validatorFactory.getValidator(); Set generalSet = validator.validate(spec); if (!generalSet.isEmpty()) { throw new ConstraintViolationException("Constraint violation for ActitvationSpec", generalSet); } } validated = true; } } }
public void afterPropertiesSet() throws Exception { if (activationSpec == null) { throw new IllegalArgumentException("activationSpec must be set"); } if (resourceAdapter == null) { resourceAdapter = activationSpec.getResourceAdapter(); } if (jcaContainer != null) { start(); } }
activationSpec.validate(); } catch (final UnsupportedOperationException uoe) { logger.info("ActivationSpec does not support validate. Implementation of validate is optional"); activationSpec.setResourceAdapter(resourceAdapter);
public void deactivate(final MessageEndpointFactory messageEndpointFactory) { ResourceAdapter resourceAdapter = activationSpec.getResourceAdapter(); if (resourceAdapter != null) { resourceAdapterWrapper.deregisterRecovery(containerId); resourceAdapterWrapper.endpointDeactivation(messageEndpointFactory, activationSpec); } else { //this should never happen, activation spec should have been registered with r.a. throw new IllegalStateException("ActivationSpec was never registered with 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.validate(); } catch (final UnsupportedOperationException uoe) { logger.info("ActivationSpec does not support validate. Implementation of validate is optional"); activationSpec.setResourceAdapter(resourceAdapter);
msgListenerType), false, resourceAdapter.getClass().getClassLoader()).newInstance()); aspec.setResourceAdapter(resourceAdapter);
/** * メッセージエンドポイントをアクティブ化します. * * @throws ResourceException * メッセージエンドポイントのアクティブ化中に例外が発生した場合 */ public void activate() throws ResourceException { assertInboundResourceAdapter(); activationSpec = createActivationSpec(); activationSpec.validate(); raDeployer.getResourceAdapter().endpointActivation(messageEndpointFactory, activationSpec); if (logger.isDebugEnabled()) { loggingDeployedMessage(); } }
public void activate(final MessageEndpointFactory messageEndpointFactory) throws ResourceException { checkConstraints(activationSpec); ResourceAdapter resourceAdapter = activationSpec.getResourceAdapter(); if (resourceAdapter == null) { resourceAdapterWrapper.registerResourceAdapterAssociation(activationSpec); } resourceAdapterWrapper.endpointActivation(messageEndpointFactory, activationSpec); resourceAdapterWrapper.doRecovery(activationSpec, containerId); }
/** * 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.validate(); } catch (final UnsupportedOperationException uoe) { logger.info("ActivationSpec does not support validate. Implementation of validate is optional"); activationSpec.setResourceAdapter(resourceAdapter);
activationSpec.setResourceAdapter(ra);
_activationSpec.validate(); } catch (Exception e) { throw error(e);
/** * 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(_ra);