* (non-Javadoc)
*
* @see org.springframework.beans.factory.FactoryBean#getObject()
*/
public Object getObject() throws Exception {
Subscribe subscribe = new Subscribe();
subscribe.setConsumerReference(AbstractWSAClient.createWSA(consumer));
subscribe.setFilter(new FilterType());
if (topic != null) {
TopicExpressionType topicExp = new TopicExpressionType();
topicExp.getContent().add(topic);
subscribe.getFilter().getAny().add(
new JAXBElement<TopicExpressionType>(AbstractSubscription.QNAME_TOPIC_EXPRESSION,
TopicExpressionType.class, topicExp));
}
if (xpath != null) {
QueryExpressionType xpathExp = new QueryExpressionType();
xpathExp.setDialect(AbstractSubscription.XPATH1_URI);
xpathExp.getContent().add(xpath);
subscribe.getFilter().getAny().add(
new JAXBElement<QueryExpressionType>(AbstractSubscription.QNAME_MESSAGE_CONTENT,
QueryExpressionType.class, xpathExp));
}
if (raw) {
subscribe.setSubscriptionPolicy(new Subscribe.SubscriptionPolicy());
subscribe.getSubscriptionPolicy().getAny().add(new UseRaw());
}
return subscribe;
}