org.hornetq.jms.server.embedded
Class EmbeddedJMS

java.lang.Object
  extended by org.hornetq.core.server.embedded.EmbeddedHornetQ
      extended by org.hornetq.jms.server.embedded.EmbeddedJMS

public class EmbeddedJMS
extends org.hornetq.core.server.embedded.EmbeddedHornetQ

Simple bootstrap class that parses hornetq config files (server and jms and security) and starts a HornetQServer instance and populates it with configured JMS endpoints.

JMS Endpoints are registered with a simple MapBindingRegistry. If you want to use a different registry you must set the registry property of this class or call the setRegistry() method if you want to use JNDI

Version:
$Revision: 1 $
Author:
Bill Burke

Field Summary
protected  Context context
           
protected  String jmsConfigResourcePath
           
protected  JMSConfiguration jmsConfiguration
           
protected  BindingRegistry registry
           
protected  JMSServerManagerImpl serverManager
           
 
Fields inherited from class org.hornetq.core.server.embedded.EmbeddedHornetQ
configResourcePath, configuration, hornetQServer, mbeanServer, securityManager
 
Constructor Summary
EmbeddedJMS()
           
 
Method Summary
 BindingRegistry getRegistry()
           
 Object lookup(String name)
          Lookup in the registry for registered object, i.e.
 void setContext(Context context)
          If you want to use JNDI instead of an internal map, set this property
 void setJmsConfigResourcePath(String jmsConfigResourcePath)
          Classpath resource where JMS config file is.
 void setJmsConfiguration(JMSConfiguration jmsConfiguration)
          By default, this class uses file-based configuration.
 void setRegistry(BindingRegistry registry)
          Only set this property if you are using a custom BindingRegistry
 void start()
           
 void stop()
           
 
Methods inherited from class org.hornetq.core.server.embedded.EmbeddedHornetQ
getHornetQServer, initStart, setConfigResourcePath, setConfiguration, setMbeanServer, setSecurityManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serverManager

protected JMSServerManagerImpl serverManager

registry

protected BindingRegistry registry

jmsConfigResourcePath

protected String jmsConfigResourcePath

jmsConfiguration

protected JMSConfiguration jmsConfiguration

context

protected Context context
Constructor Detail

EmbeddedJMS

public EmbeddedJMS()
Method Detail

setJmsConfigResourcePath

public void setJmsConfigResourcePath(String jmsConfigResourcePath)
Classpath resource where JMS config file is. Defaults to 'hornetq-jms.xml'

Parameters:
jmsConfigResourcePath -

getRegistry

public BindingRegistry getRegistry()

setRegistry

public void setRegistry(BindingRegistry registry)
Only set this property if you are using a custom BindingRegistry

Parameters:
registry -

setJmsConfiguration

public void setJmsConfiguration(JMSConfiguration jmsConfiguration)
By default, this class uses file-based configuration. Set this property to override it.

Parameters:
jmsConfiguration -

setContext

public void setContext(Context context)
If you want to use JNDI instead of an internal map, set this property

Parameters:
context -

lookup

public Object lookup(String name)
Lookup in the registry for registered object, i.e. a ConnectionFactory.

This is a convenience method.

Parameters:
name -

start

public void start()
           throws Exception
Overrides:
start in class org.hornetq.core.server.embedded.EmbeddedHornetQ
Throws:
Exception

stop

public void stop()
          throws Exception
Overrides:
stop in class org.hornetq.core.server.embedded.EmbeddedHornetQ
Throws:
Exception


Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.