1 17 package org.apache.servicemix.wsn.spring; 18 19 import org.apache.servicemix.wsn.client.AbstractWSAClient; 20 import org.oasis_open.docs.wsn.b_2.TopicExpressionType; 21 import org.oasis_open.docs.wsn.br_2.RegisterPublisher; 22 import org.springframework.beans.factory.FactoryBean; 23 24 30 public class RegisterPublisherFactoryBean implements FactoryBean { 31 32 private String publisher; 33 private String topic; 34 private boolean demand; 35 36 39 public boolean isDemand() { 40 return demand; 41 } 42 43 46 public void setDemand(boolean demand) { 47 this.demand = demand; 48 } 49 50 53 public String getPublisher() { 54 return publisher; 55 } 56 57 60 public void setPublisher(String publisher) { 61 this.publisher = publisher; 62 } 63 64 67 public String getTopic() { 68 return topic; 69 } 70 71 74 public void setTopic(String topic) { 75 this.topic = topic; 76 } 77 78 81 public Object getObject() throws Exception { 82 RegisterPublisher registerPublisher = new RegisterPublisher(); 83 registerPublisher.setPublisherReference(AbstractWSAClient.createWSA(publisher)); 84 if (topic != null) { 85 TopicExpressionType topicExp = new TopicExpressionType(); 86 topicExp.getContent().add(topic); 87 registerPublisher.getTopic().add(topicExp); 88 } 89 registerPublisher.setDemand(new Boolean (demand)); 90 return registerPublisher; 91 } 92 93 96 public Class getObjectType() { 97 return RegisterPublisher.class; 98 } 99 100 103 public boolean isSingleton() { 104 return false; 105 } 106 107 } 108 | Popular Tags |