use of org.jaffa.loader.ContextKey in project jaffa-framework by jaffa-projects.
the class MessagingManager method getMessageInfo.
/**
* Returns the MessageInfo object for the input dataBeanClass,
* as defined in the configuration file.
* @param dataBeanClass key used for the repository
* @return the MessageInfo object for the input dataBeanClass
*/
public MessageInfo getMessageInfo(String dataBeanClass) {
MessageInfo messageInfo = messageInfoRepository.query(dataBeanClass);
if (messageInfo == null) {
// Lookup the class heirarchy. Add a NULL for the dataBeanClassName, even if a MessageInfo is not found
synchronized (messageInfoRepository) {
messageInfo = messageInfoRepository.query(dataBeanClass);
try {
if (messageInfo == null) {
Class clazz = Class.forName(dataBeanClass);
ContextKey superClassContextKey = null;
while (clazz.getSuperclass() != null && messageInfo == null) {
clazz = clazz.getSuperclass();
messageInfo = messageInfoRepository.query(clazz.getName());
superClassContextKey = messageInfoRepository.findKey(clazz.getName());
}
if (superClassContextKey != null) {
messageInfoRepository.register(new ContextKey(dataBeanClass, superClassContextKey.getFileName(), superClassContextKey.getVariation(), superClassContextKey.getPrecedence()), messageInfo);
}
}
} catch (ClassNotFoundException e) {
log.error("Unable to find class definition for " + dataBeanClass, e);
}
}
}
return messageInfo;
}
use of org.jaffa.loader.ContextKey in project jaffa-framework by jaffa-projects.
the class SchedulerManager method unregisterResource.
/**
* {@inheritDoc}
*/
@Override
public void unregisterResource(Resource resource, String context, String variation) throws JAXBException, SAXException, IOException {
Config config = JAXBHelper.unmarshalConfigFile(Config.class, resource, CONFIGURATION_SCHEMA_FILE);
if (config.getTask() != null) {
for (final Task schedulerTask : config.getTask()) {
ContextKey contextKey = new ContextKey(schedulerTask.getDataBean(), resource.getURI().toString(), variation, context);
unregisterSchedulerTask(contextKey);
}
}
}
use of org.jaffa.loader.ContextKey in project jaffa-framework by jaffa-projects.
the class SchedulerManager method getSchedulerTask.
/**
* Returns the scheduler task object for the input dataBeanClass, as defined in the configuration file.
*
* @param dataBeanClass the class for a dataBean.
* @return the TransactionInfo object for the input dataBeanClass, as defined in the configuration file.
*/
public Task getSchedulerTask(String dataBeanClass) {
Task task = schedulerTaskRepository.query(dataBeanClass);
if (task == null) {
// Lookup the class hierarchy. Add a NULL for the dataBeanClassName, even if a Task is not found
synchronized (schedulerTaskRepository) {
task = schedulerTaskRepository.query(dataBeanClass);
try {
if (task == null) {
Class clazz = Class.forName(dataBeanClass);
ContextKey superClassContextKey = null;
while (clazz.getSuperclass() != null && task == null) {
clazz = clazz.getSuperclass();
task = schedulerTaskRepository.query(clazz.getName());
superClassContextKey = schedulerTaskRepository.findKey(clazz.getName());
}
if (superClassContextKey != null) {
schedulerTaskRepository.register(new ContextKey(dataBeanClass, superClassContextKey.getFileName(), superClassContextKey.getVariation(), superClassContextKey.getVariation()), task);
}
}
} catch (ClassNotFoundException e) {
log.error("Unable to find class definition for " + dataBeanClass, e);
}
}
}
return task;
}
use of org.jaffa.loader.ContextKey in project jaffa-framework by jaffa-projects.
the class SchedulerManager method registerResource.
/**
* {@inheritDoc}
*/
@Override
public void registerResource(Resource resource, String context, String variation) throws JAXBException, SAXException, IOException {
Config config = JAXBHelper.unmarshalConfigFile(Config.class, resource, CONFIGURATION_SCHEMA_FILE);
if (config.getTask() != null) {
for (final Task schedulerTask : config.getTask()) {
ContextKey contextKey = new ContextKey(schedulerTask.getDataBean(), resource.getURI().toString(), variation, context);
registerSchedulerTask(contextKey, schedulerTask);
}
}
}
use of org.jaffa.loader.ContextKey in project jaffa-framework by jaffa-projects.
the class SoaEventManager method unregisterResource.
/**
* {@inheritDoc}
*/
@Override
public void unregisterResource(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);
unregisterSoaEventInfo(contextKey);
}
}
}
Aggregations