Java 类javax.xml.rpc.server.ServletEndpointContext 实例源码

项目:jbossws-common    文件:InvocationHandlerJAXRPC.java   
/**
 * Calls {@link javax.xml.rpc.server.ServiceLifecycle#init(Object)}
 * method on target bean if this bean implements 
 * {@link javax.xml.rpc.server.ServiceLifecycle} interface.
 *
 * @param invocation current invocation
 * @throws Exception if any error occurs
 */
@Override
public void onBeforeInvocation(final Invocation invocation) throws Exception
{
   final InvocationContext invocationContext = invocation.getInvocationContext();
   final Object targetBean = invocationContext.getTargetBean();
   final boolean isJaxrpcLifecycleBean = targetBean instanceof ServiceLifecycle;

   if (isJaxrpcLifecycleBean)
   {
      final ServletEndpointContext sepContext = invocationContext.getAttachment(ServletEndpointContext.class);
      ((ServiceLifecycle) targetBean).init(sepContext);
   }
}
项目:jplag    文件:JPlagTypImpl.java   
/**
 * Initializes the web service and starts the main thread
 */
public void init(Object context) throws ServiceException {
    servletEndpointContext = (ServletEndpointContext) context;

    // ensure that entry and result directories exist
    AccessStructure.ensureExistence();

    // create and start jplagCentral thread
    JPLAG_CENTRAL = JPlagCentral.getInstance();
    JPLAG_CENTRAL.start();
}
项目:class-guard    文件:ServletEndpointSupport.java   
/**
 * Initialize this JAX-RPC servlet endpoint.
 * Calls onInit after successful context initialization.
 * @param context ServletEndpointContext
 * @throws ServiceException if the context is not a ServletEndpointContext
 * @see #onInit
 */
public final void init(Object context) throws ServiceException {
    if (!(context instanceof ServletEndpointContext)) {
        throw new ServiceException("ServletEndpointSupport needs ServletEndpointContext, not [" + context + "]");
    }
    this.servletEndpointContext = (ServletEndpointContext) context;
    ServletContext servletContext = this.servletEndpointContext.getServletContext();
    this.webApplicationContext = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
    this.messageSourceAccessor = new MessageSourceAccessor(this.webApplicationContext);
    onInit();
}
项目:class-guard    文件:ServletEndpointSupport.java   
/**
 * Return the current JAX-RPC ServletEndpointContext.
 */
protected final ServletEndpointContext getServletEndpointContext() {
    return this.servletEndpointContext;
}
项目:tomee    文件:WsServlet.java   
private static ServletEndpointContext getContext() {
    ServletEndpointContext context = endpointContext.get();
    return context != null ? context : DEFAULT_CONTEXT;
}