Search in sources :

Example 1 with InboundEndpoint

use of org.apache.cxf.jca.inbound.InboundEndpoint in project cxf by apache.

the class ResourceAdapterImpl method endpointDeactivation.

public void endpointDeactivation(MessageEndpointFactory mef, ActivationSpec as) {
    if (!(as instanceof MDBActivationSpec)) {
        LOG.fine("Ignored unknown activation spec " + as);
        return;
    }
    MDBActivationSpec spec = (MDBActivationSpec) as;
    LOG.info("CXF resource adapter is deactivating " + spec.getDisplayName());
    InboundEndpoint endpoint = endpoints.remove(spec.getDisplayName());
    if (endpoint != null) {
        try {
            endpoint.shutdown();
        } catch (Exception e) {
            LOG.log(Level.WARNING, "Failed to stop endpoint " + spec.getDisplayName(), e);
        }
    }
}
Also used : InboundEndpoint(org.apache.cxf.jca.inbound.InboundEndpoint) MDBActivationSpec(org.apache.cxf.jca.inbound.MDBActivationSpec) ResourceException(javax.resource.ResourceException) ResourceAdapterInternalException(javax.resource.spi.ResourceAdapterInternalException) NotSupportedException(javax.resource.NotSupportedException)

Example 2 with InboundEndpoint

use of org.apache.cxf.jca.inbound.InboundEndpoint in project cxf by apache.

the class ResourceAdapterImpl method stop.

public void stop() {
    LOG.fine("Resource Adapter is being stopped by appserver...");
    if (!busCache.isEmpty()) {
        for (Bus bus : busCache) {
            bus.shutdown(true);
        }
    }
    // shutdown all the inbound endpoints
    for (Map.Entry<String, InboundEndpoint> entry : endpoints.entrySet()) {
        try {
            entry.getValue().shutdown();
        } catch (Exception e) {
            LOG.log(Level.WARNING, "Failed to stop endpoint " + entry.getKey(), e);
        }
    }
    endpoints.clear();
}
Also used : InboundEndpoint(org.apache.cxf.jca.inbound.InboundEndpoint) Bus(org.apache.cxf.Bus) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Map(java.util.Map) ResourceException(javax.resource.ResourceException) ResourceAdapterInternalException(javax.resource.spi.ResourceAdapterInternalException) NotSupportedException(javax.resource.NotSupportedException)

Aggregations

NotSupportedException (javax.resource.NotSupportedException)2 ResourceException (javax.resource.ResourceException)2 ResourceAdapterInternalException (javax.resource.spi.ResourceAdapterInternalException)2 InboundEndpoint (org.apache.cxf.jca.inbound.InboundEndpoint)2 Map (java.util.Map)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 Bus (org.apache.cxf.Bus)1 MDBActivationSpec (org.apache.cxf.jca.inbound.MDBActivationSpec)1