Search in sources :

Example 1 with UriHandlerInit

use of org.apache.cxf.jca.core.resourceadapter.UriHandlerInit in project cxf by apache.

the class JCABusFactory method init.

protected synchronized void init() throws ResourceException {
    LOG.info("Initializing the CXF Bus ...");
    new UriHandlerInit();
    ClassLoader original = Thread.currentThread().getContextClassLoader();
    try {
        ClassLoader cl = this.getClass().getClassLoader();
        // ensure resourceadapter: url handler can be found by URLFactory
        Thread.currentThread().setContextClassLoader(cl);
        // TODO Check for the managed connection factory properties
        // TODO We may need get the configuration file from properties
        BusFactory bf = BusFactory.newInstance();
        bus = bf.createBus();
        initializeServants();
    } catch (ResourceAdapterInternalException ex) {
        throw ex;
    } catch (Exception ex) {
        throw new ResourceAdapterInternalException(new Message("FAIL_TO_INITIALIZE_JCABUSFACTORY", BUNDLE).toString(), ex);
    } finally {
        Thread.currentThread().setContextClassLoader(original);
    }
}
Also used : Message(org.apache.cxf.common.i18n.Message) BusFactory(org.apache.cxf.BusFactory) ResourceAdapterInternalException(org.apache.cxf.jca.core.resourceadapter.ResourceAdapterInternalException) UriHandlerInit(org.apache.cxf.jca.core.resourceadapter.UriHandlerInit) ResourceException(javax.resource.ResourceException) ResourceAdapterInternalException(org.apache.cxf.jca.core.resourceadapter.ResourceAdapterInternalException) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 ResourceException (javax.resource.ResourceException)1 BusFactory (org.apache.cxf.BusFactory)1 Message (org.apache.cxf.common.i18n.Message)1 ResourceAdapterInternalException (org.apache.cxf.jca.core.resourceadapter.ResourceAdapterInternalException)1 UriHandlerInit (org.apache.cxf.jca.core.resourceadapter.UriHandlerInit)1