public void start(Endpoint ep) { if (log.isTraceEnabled()) log.trace("Start: " + ep.getName()); EndpointState state = ep.getState(); if (state != EndpointState.UNDEFINED) { log.error("Cannot start endpoint in state: " + state); } else { if (ep.getEndpointMetrics() != null) ep.getEndpointMetrics().start(); InvocationHandler invHandler = ep.getInvocationHandler(); if (invHandler == null) throw new IllegalStateException("Invocation handler not available"); invHandler.init(ep); ep.setState(EndpointState.STARTED); } }
/** * This overrides org.apache.cxf.jaxws.AbstractInvoker in order for using the JBossWS integration logic * to invoke the JBoss AS target bean. */ @Override protected Object performInvocation(Exchange exchange, final Object serviceObject, Method m, Object[] paramArray) throws Exception { Endpoint ep = exchange.get(Endpoint.class); final InvocationHandler invHandler = ep.getInvocationHandler(); final Invocation inv = createInvocation(invHandler, serviceObject, ep, m, paramArray); if (factory != null) { inv.getInvocationContext().setProperty("forceTargetBean", true); } Bus threadBus = BusFactory.getThreadDefaultBus(false); BusFactory.setThreadDefaultBus(disableDepUserDefThreadBus ? null : ep.getAttachment(Bus.class)); setNamespaceContextSelector(exchange); ClassLoader cl = SecurityActions.getContextClassLoader(); SecurityActions.setContextClassLoader(serviceObject.getClass().getClassLoader()); try { invHandler.invoke(ep, inv); return inv.getReturnValue(); } finally { SecurityActions.setContextClassLoader(cl); //make sure the right bus is restored after coming back from the endpoint method BusFactory.setThreadDefaultBus(threadBus); clearNamespaceContextSelector(exchange); } }
public void start(Endpoint ep) { EndpointState state = ep.getState(); if (state != EndpointState.UNDEFINED) { Loggers.DEPLOYMENT_LOGGER.cannotStartEndpoint(state, ep.getName()); } else { if (ep.getEndpointMetrics() != null) ep.getEndpointMetrics().start(); InvocationHandler invHandler = ep.getInvocationHandler(); if (invHandler == null) throw Messages.MESSAGES.invocationHandlerNotAvailable(ep.getName()); invHandler.init(ep); ep.setState(EndpointState.STARTED); } }
InvocationHandler invHandler = endpoint.getInvocationHandler();