Search in sources :

Example 1 with JndiConfig

use of org.jaffa.modules.messaging.services.configdomain.JndiConfig in project jaffa-framework by jaffa-projects.

the class JndiJmsManager method registerResource.

/**
 * Unmarshall the contents of the configuration to create and register
 * JmsConfig objects.
 * @param resource the object that contains the xml config file.
 * @param context key with which config file to be registered.
 * @param variation key with which config file to be registered.
 * @throws JAXBException
 * @throws SAXException
 * @throws IOException
 */
@Override
public void registerResource(Resource resource, String context, String variation) throws JAXBException, SAXException, IOException {
    JndiConfig config = JAXBHelper.unmarshalConfigFile(JndiConfig.class, resource, JMS_JNDI_CONFIGURATION_SCHEMA_FILE);
    JmsConfig jmsConfig = config.getJmsConfig();
    populateJmsConfig(jmsConfig);
    ContextKey contextKey = new ContextKey(jmsConfig.getUser(), resource.getURI().toString(), variation, context);
    jmsRepository.register(contextKey, jmsConfig);
}
Also used : JndiConfig(org.jaffa.modules.messaging.services.configdomain.JndiConfig) ContextKey(org.jaffa.loader.ContextKey) JmsConfig(org.jaffa.modules.messaging.services.configdomain.JmsConfig)

Example 2 with JndiConfig

use of org.jaffa.modules.messaging.services.configdomain.JndiConfig in project jaffa-framework by jaffa-projects.

the class JndiJmsManager method unregisterResource.

/**
 * Unregister the JmsConfig objects defined by a particular resource.
 * @param resource the object that contains the xml config file.
 * @param context key with which config file to be registered.
 * @param variation key with which config file to be registered.
 * @throws JAXBException
 * @throws SAXException
 * @throws IOException
 */
@Override
public void unregisterResource(Resource resource, String context, String variation) throws JAXBException, SAXException, IOException {
    JndiConfig config = JAXBHelper.unmarshalConfigFile(JndiConfig.class, resource, JMS_JNDI_CONFIGURATION_SCHEMA_FILE);
    JmsConfig jmsConfig = config.getJmsConfig();
    ContextKey contextKey = new ContextKey(jmsConfig.getUser(), resource.getURI().toString(), variation, context);
    jmsRepository.unregister(contextKey);
}
Also used : JndiConfig(org.jaffa.modules.messaging.services.configdomain.JndiConfig) ContextKey(org.jaffa.loader.ContextKey) JmsConfig(org.jaffa.modules.messaging.services.configdomain.JmsConfig)

Aggregations

ContextKey (org.jaffa.loader.ContextKey)2 JmsConfig (org.jaffa.modules.messaging.services.configdomain.JmsConfig)2 JndiConfig (org.jaffa.modules.messaging.services.configdomain.JndiConfig)2