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); } }
public Context getJNDIContext() { Context retVal = null; try { retVal = getInvocationHandler().getJNDIContext(this); } catch (NamingException e) { log.error("JNDI not available neither in JSE environment nor in SAR archives.", e); } return retVal; }
/** * 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); } }
private Invocation createInvocation(InvocationHandler invHandler, Object serviceObject, Endpoint ep, Method m, Object[] paramArray) { Invocation inv = invHandler.createInvocation(); InvocationContext invContext = inv.getInvocationContext(); WebServiceContext wsCtx = new WebServiceContextImpl(null); invContext.addAttachment(WebServiceContext.class, wsCtx); invContext.setTargetBean(serviceObject); inv.setJavaMethod(m); inv.setArgs(paramArray); return inv; }
invHandler.invoke(endpoint, inv);
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); } }