| Method from org.jboss.jms.jndi.JMSProviderLoader Detail: |
public String getAdapterJNDIName() {
return jndiName;
}
|
public String getFactoryRef() {
return factoryRef;
}
|
public String getName() {
return providerName;
}
|
public Properties getProperties() {
return properties;
}
|
public String getProviderAdapterClass() {
return providerAdapterClass;
}
|
public String getProviderName() {
return providerName;
}
|
public String getQueueFactoryRef() {
return queueFactoryRef;
}
|
public String getTopicFactoryRef() {
return topicFactoryRef;
}
|
public void setAdapterJNDIName(String name) {
this.jndiName = name;
}
|
public void setFactoryRef(String newFactoryRef) {
factoryRef = newFactoryRef;
}
|
public void setProperties(Properties properties) {
this.properties = properties;
}
|
public void setProviderAdapterClass(String clazz) {
providerAdapterClass = clazz;
}
|
public void setProviderName(String name) {
this.providerName = name;
}
|
public void setQueueFactoryRef(String newQueueFactoryRef) {
queueFactoryRef = newQueueFactoryRef;
}
|
public void setTopicFactoryRef(String newTopicFactoryRef) {
topicFactoryRef = newTopicFactoryRef;
}
|
protected void startService() throws Exception {
// validate the configuration
if (queueFactoryRef == null)
throw new DeploymentException("missing required attribute: QueueFactoryRef");
if (topicFactoryRef == null)
throw new DeploymentException("missing required attribute: TopicFactoryRef");
Class cls = Thread.currentThread().getContextClassLoader().loadClass(providerAdapterClass);
providerAdapter = (JMSProviderAdapter) cls.newInstance();
providerAdapter.setName(providerName);
providerAdapter.setProperties(properties);
providerAdapter.setFactoryRef(factoryRef);
providerAdapter.setQueueFactoryRef(queueFactoryRef);
providerAdapter.setTopicFactoryRef(topicFactoryRef);
InitialContext context = new InitialContext();
try
{
// Bind in JNDI
if (jndiName == null)
{
String name = providerAdapter.getName();
jndiName = "java:/" + name;
}
bind(context, jndiName, providerAdapter);
log.debug("Bound adapter to " + jndiName);
}
finally
{
context.close();
}
}
|
protected void stopService() throws Exception {
InitialContext context = new InitialContext();
try
{
// Unbind from JNDI
String name = providerAdapter.getName();
String jndiname = "java:/" + name;
context.unbind(jndiname);
log.debug("unbound adapter " + name + " from " + jndiname);
}
finally
{
context.close();
}
}
|