use of org.jaffa.transaction.services.configdomain.Config in project jaffa-framework by jaffa-projects.
the class TransactionManager method unregisterXML.
/**
* unregisters all the transactions and typeInfo in the xml from the repository
* @param uri for the xml location
*/
public void unregisterXML(String uri, String context, String variation) throws JAXBException, SAXException, IOException {
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
Config config = JAXBHelper.unmarshalConfigFile(Config.class, resolver.getResource(uri), CONFIGURATION_SCHEMA_FILE);
if (config.getTransactionOrType() != null) {
for (final Object o : config.getTransactionOrType()) {
if (o.getClass() == TransactionInfo.class) {
final TransactionInfo transactionInfo = (TransactionInfo) o;
ContextKey contextKey = new ContextKey(transactionInfo.getDataBean(), uri, variation, context);
unregisterTransactionInfo(contextKey);
} else if (o.getClass() == TypeInfo.class) {
final TypeInfo typeInfo = (TypeInfo) o;
ContextKey contextKey = new ContextKey(typeInfo.getName(), uri, variation, context);
unregisterTypeInfo(contextKey);
}
}
}
}
use of org.jaffa.transaction.services.configdomain.Config in project jaffa-framework by jaffa-projects.
the class TransactionManager 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.getTransactionOrType() != null) {
for (final Object o : config.getTransactionOrType()) {
if (o.getClass() == TransactionInfo.class) {
final TransactionInfo transactionInfo = (TransactionInfo) o;
ContextKey contextKey = new ContextKey(transactionInfo.getDataBean(), resource.getURI().toString(), variation, context);
registerTransactionInfo(contextKey, transactionInfo);
} else if (o.getClass() == TypeInfo.class) {
final TypeInfo typeInfo = (TypeInfo) o;
ContextKey contextKey = new ContextKey(typeInfo.getName(), resource.getURI().toString(), variation, context);
registerTypeInfo(contextKey, typeInfo);
}
}
}
}
use of org.jaffa.transaction.services.configdomain.Config in project jaffa-framework by jaffa-projects.
the class TransactionManager 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.getTransactionOrType() != null) {
for (final Object o : config.getTransactionOrType()) {
if (o.getClass() == TransactionInfo.class) {
final TransactionInfo transactionInfo = (TransactionInfo) o;
ContextKey contextKey = new ContextKey(transactionInfo.getDataBean(), resource.getURI().toString(), variation, context);
unregisterTransactionInfo(contextKey);
} else if (o.getClass() == TypeInfo.class) {
final TypeInfo typeInfo = (TypeInfo) o;
ContextKey contextKey = new ContextKey(typeInfo.getName(), resource.getURI().toString(), variation, context);
unregisterTypeInfo(contextKey);
}
}
}
}
Aggregations