use of org.jaffa.loader.ContextKey in project jaffa-framework by jaffa-projects.
the class BusinessFunctionManager method registerResource.
/**
* registerResource - Registers the roles into the business function repository from a business-functions.xml file.
* @param resource the object that contains the xml config file.
* @param context 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 {
BusinessFunctions businessFunctions = JAXBHelper.unmarshalConfigFile(BusinessFunctions.class, resource, CONFIGURATION_SCHEMA_FILE);
if (businessFunctions.getBusinessFunction() != null) {
for (final BusinessFunction businessFunction : businessFunctions.getBusinessFunction()) {
ContextKey contextKey = new ContextKey(businessFunction.getName(), resource.getURI().toString(), variation, context);
registerBusinessFunction(contextKey, businessFunction);
}
}
}
use of org.jaffa.loader.ContextKey in project jaffa-framework by jaffa-projects.
the class RoleManager method registerResource.
/**
* registerResource - Registers the roles into the role repository from the roles.xml files found in META-INF/roles.xml
* that exist in the classpath.
* @param resource the object that contains the xml config file.
* @param context 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 {
Roles roles = JAXBHelper.unmarshalConfigFile(Roles.class, resource, CONFIGURATION_SCHEMA_FILE);
if (roles.getRole() != null) {
for (final Role role : roles.getRole()) {
ContextKey key = new ContextKey(role.getName(), resource.getURI().toString(), variation, context);
registerRole(key, role);
}
}
}
use of org.jaffa.loader.ContextKey in project jaffa-framework by jaffa-projects.
the class MessagingManager method registerResource.
/**
* Unmarshall the contents of the configuration to create and register
* MessageInfo, QueueInfo, TopicInfo, and/or MessageFilter 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 {
Config config = JAXBHelper.unmarshalConfigFile(Config.class, resource, CONFIGURATION_SCHEMA_FILE);
List<Object> messageObjects = config.getMessageOrQueueOrTopic();
if (messageObjects != null) {
for (final Object o : messageObjects) {
if (o instanceof MessageInfo) {
final MessageInfo info = (MessageInfo) o;
validateMessageInfo(info);
ContextKey contextKey = new ContextKey(info.getDataBean(), resource.getURI().toString(), variation, context);
registerMessageInfo(contextKey, info);
} else if (o instanceof QueueInfo) {
final QueueInfo info = (QueueInfo) o;
ContextKey contextKey = new ContextKey(info.getName(), resource.getURI().toString(), variation, context);
registerQueueInfo(contextKey, info);
} else if (o instanceof TopicInfo) {
final TopicInfo info = (TopicInfo) o;
ContextKey contextKey = new ContextKey(info.getName(), resource.getURI().toString(), variation, context);
registerTopicInfo(contextKey, info);
} else if (o instanceof MessageFilter) {
final MessageFilter filter = (MessageFilter) o;
ContextKey contextKey = new ContextKey(filter.getFilterName(), resource.getURI().toString(), variation, context);
registerMessageFilter(contextKey, filter);
} else {
log.warn("MessagingObject.registerResource, unexpected object: " + o);
}
}
// for
checkForQueueAndTopicNamingConflicts();
}
}
use of org.jaffa.loader.ContextKey in project jaffa-framework by jaffa-projects.
the class MessagingManager method unregisterResource.
/**
* Unregister the message 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 {
Config config = JAXBHelper.unmarshalConfigFile(Config.class, resource, CONFIGURATION_SCHEMA_FILE);
List<Object> messageObjects = config.getMessageOrQueueOrTopic();
if (messageObjects != null) {
for (final Object o : messageObjects) {
if (o instanceof MessageInfo) {
final MessageInfo info = (MessageInfo) o;
validateMessageInfo(info);
ContextKey contextKey = new ContextKey(info.getDataBean(), resource.getURI().toString(), variation, context);
unregisterMessageInfo(contextKey);
} else if (o instanceof QueueInfo) {
final QueueInfo info = (QueueInfo) o;
ContextKey contextKey = new ContextKey(info.getName(), resource.getURI().toString(), variation, context);
unregisterQueueInfo(contextKey);
} else if (o instanceof TopicInfo) {
final TopicInfo info = (TopicInfo) o;
ContextKey contextKey = new ContextKey(info.getName(), resource.getURI().toString(), variation, context);
unregisterTopicInfo(contextKey);
} else if (o instanceof MessageFilter) {
final MessageFilter filter = (MessageFilter) o;
ContextKey contextKey = new ContextKey(filter.getFilterName(), resource.getURI().toString(), variation, context);
unregisterMessageFilter(contextKey);
} else {
log.warn("MessagingObject.registerResource, unexpected object: " + o);
}
}
// for
checkForQueueAndTopicNamingConflicts();
}
}
use of org.jaffa.loader.ContextKey in project jaffa-framework by jaffa-projects.
the class SoaEventManager method registerResource.
/**
* {@inheritDoc}
*/
@Override
public void registerResource(Resource resource, String context, String variation) throws JAXBException, SAXException, IOException {
SoaEvents soaEvents = JAXBHelper.unmarshalConfigFile(SoaEvents.class, resource, CONFIGURATION_SCHEMA_FILE);
if (soaEvents != null) {
for (SoaEventInfo soaEventInfo : soaEvents.getSoaEvent()) {
ContextKey contextKey = new ContextKey(soaEventInfo.getName(), resource.getURI().toString(), variation, context);
registerSoaEventInfo(contextKey, soaEventInfo);
}
}
}
Aggregations