}
EndpointReferenceType subscriptionEPR = null;
boolean useNotify = request.isSetUseNotify() ? request.getUseNotify() : true; // NOTE: we must set the default value ourselves, as XMLBeans does NOT do this for us
EndpointReference producerEPR = getResource().getEndpointReference();
SubscriptionHome subscriptionHome = null;
try
{
subscriptionHome = (SubscriptionHome) new InitialContext().lookup(
SubscriptionHome.HOME_LOCATION );
}
catch ( NamingException ne )
{
LOG.error( "Subscribe failed due to internal error: " + ne );
throw new BaseFaultException( NAMESPACE_SET, "Subscribe failed due to internal server error." );
}
Subscription subscription = null;
try
{
subscription = subscriptionHome.create( SubscriptionResource.class,
new XmlBeansEndpointReference( request.getConsumerReference() ), producerEPR, initialTerminationTime,
subPolicy, precondition, selector, getResourceKey(),
( (AbstractResourceContext) getResourceContext() ).getResourceHomeLocation(), topicExpr, useNotify, (WsnNamespaceVersionHolder) getNamespaceSet() );
}
catch ( Exception e )