Search in sources :

Example 1 with WorkContextHandler

use of com.sun.appserv.connectors.internal.api.WorkContextHandler in project Payara by payara.

the class BootstrapContextImpl method isContextSupported.

/**
 * {@inheritDoc}
 */
public boolean isContextSupported(Class<? extends WorkContext> aClass) {
    WorkContextHandler wch = ConnectorRuntime.getRuntime().getWorkContextHandler();
    wch.init(moduleName, rarCL);
    return wch.isContextSupported(true, aClass.getName());
}
Also used : WorkContextHandler(com.sun.appserv.connectors.internal.api.WorkContextHandler)

Example 2 with WorkContextHandler

use of com.sun.appserv.connectors.internal.api.WorkContextHandler in project Payara by payara.

the class ActiveOutboundResourceAdapter method validateWorkContextSupport.

/**
 * check whether the <i>required-work-context</i> list mandated by the resource-adapter
 * is supported by the application server
 * @param desc ConnectorDescriptor
 * @throws ConnectorRuntimeException when unable to support any of the requested work-context type.
 */
private void validateWorkContextSupport(ConnectorDescriptor desc) throws ConnectorRuntimeException {
    Set workContexts = desc.getRequiredWorkContexts();
    Iterator workContextsIterator = workContexts.iterator();
    WorkContextHandler workContextHandler = connectorRuntime_.getWorkContextHandler();
    workContextHandler.init(moduleName_, jcl_);
    while (workContextsIterator.hasNext()) {
        String ic = (String) workContextsIterator.next();
        boolean supported = workContextHandler.isContextSupported(true, ic);
        if (!supported) {
            String errorMsg = "Unsupported work context [ " + ic + " ] ";
            Object[] params = new Object[] { ic, desc.getName() };
            _logger.log(Level.WARNING, "unsupported.work.context", params);
            throw new ConnectorRuntimeException(errorMsg);
        }
    }
}
Also used : ConnectorRuntimeException(com.sun.appserv.connectors.internal.api.ConnectorRuntimeException) AdminObject(com.sun.enterprise.deployment.AdminObject) WorkContextHandler(com.sun.appserv.connectors.internal.api.WorkContextHandler)

Aggregations

WorkContextHandler (com.sun.appserv.connectors.internal.api.WorkContextHandler)2 ConnectorRuntimeException (com.sun.appserv.connectors.internal.api.ConnectorRuntimeException)1 AdminObject (com.sun.enterprise.deployment.AdminObject)1