Search in sources :

Example 1 with Reference

use of org.jboss.wsf.spi.deployment.Reference in project jbossws-cxf by jbossws.

the class ServletHelper method injectServiceAndHandlerResources.

private static void injectServiceAndHandlerResources(Endpoint endpoint) {
    org.apache.cxf.endpoint.Endpoint ep = endpoint.getAttachment(org.apache.cxf.endpoint.Endpoint.class);
    if (ep != null) {
        @SuppressWarnings("rawtypes") List<Handler> chain = ((JaxWsEndpointImpl) ep).getJaxwsBinding().getHandlerChain();
        if (chain != null) {
            for (Handler<?> handler : chain) {
                if (handler instanceof ConfigDelegateHandler) {
                    handler = ((ConfigDelegateHandler<?>) handler).getDelegate();
                }
                final Reference handlerReference = endpoint.getInstanceProvider().getInstance(handler.getClass().getName());
                if (!handlerReference.isInitialized()) {
                    final Object handlerInstance = handlerReference.getValue();
                    InjectionHelper.callPostConstructMethod(handlerInstance);
                    handlerReference.setInitialized();
                }
            }
        }
    }
}
Also used : ConfigDelegateHandler(org.jboss.ws.common.configuration.ConfigDelegateHandler) Reference(org.jboss.wsf.spi.deployment.Reference) ConfigDelegateHandler(org.jboss.ws.common.configuration.ConfigDelegateHandler) Handler(javax.xml.ws.handler.Handler) RequestHandler(org.jboss.wsf.spi.invocation.RequestHandler)

Aggregations

Handler (javax.xml.ws.handler.Handler)1 ConfigDelegateHandler (org.jboss.ws.common.configuration.ConfigDelegateHandler)1 Reference (org.jboss.wsf.spi.deployment.Reference)1 RequestHandler (org.jboss.wsf.spi.invocation.RequestHandler)1