Example usage for javax.resource.spi ActivationSpec getClass

List of usage examples for javax.resource.spi ActivationSpec getClass

Introduction

In this page you can find the example usage for javax.resource.spi ActivationSpec getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:me.jtalk.socketconnector.SocketResourceAdapter.java

@Override
public void endpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec spec)
        throws ResourceException {
    log.info("Endpoint activation request received for class {0}",
            endpointFactory.getEndpointClass().getCanonicalName());
    if (!this.running.get()) {
        throw new ResourceException("This resource adapter is stopped");
    }// ww w.  j  av  a  2s .  co m
    if (!(spec instanceof TCPActivationSpec)) {
        throw new NotSupportedException(
                "Activation spec supplied has unsupported type " + spec.getClass().getCanonicalName());
    } else {
        log.info("Endpoint activation for class {0}", endpointFactory.getEndpointClass().getCanonicalName());
        this.activateTCP(endpointFactory, (TCPActivationSpec) spec);
        log.info("Endpoint activated for class {0}", endpointFactory.getEndpointClass().getCanonicalName());
    }
}