Package com.sun.xml.rpc.spi.runtime

Examples of com.sun.xml.rpc.spi.runtime.Tie


    }

    private Implementor createImplementor(RuntimeEndpointInfo targetEndpoint)
        throws Exception {

        Tie tie = (Tie) targetEndpoint.getTieClass().newInstance();

        Class seiClass  = targetEndpoint.getRemoteInterface();
        Class implClass = targetEndpoint.getImplementationClass();

        Remote servant  = null;
        if( seiClass.isAssignableFrom(implClass) ) {
            // if servlet endpoint impl is a subtype of SEI, use an
            // instance as the servant.
            servant = (Remote) implClass.newInstance();
        } else {
            // Create a dynamic proxy that implements SEI (and optionally
            // ServiceLifecycle) and delegates to an instance of the
            // endpoint impl.
            Object implInstance = implClass.newInstance();

            InvocationHandler handler =
                new ServletImplInvocationHandler(implInstance);
            boolean implementsLifecycle =
                ServiceLifecycle.class.isAssignableFrom(implClass);
            Class[] proxyInterfaces = implementsLifecycle ?
                new Class[] { seiClass, ServiceLifecycle.class } :
                new Class[] { seiClass };

            servant = (Remote) Proxy.newProxyInstance
                (implClass.getClassLoader(), proxyInterfaces, handler);
        }
        tie.setTarget(servant);
       
        Implementor implementor = rpcFactory_.createImplementor(servletContext_, tie);
        implementor.init();

        return implementor;
View Full Code Here


      _logger.fine("ws.processRequest");
  }

        final SOAPMessageContext finalMC = messageContext;
  Implementor implementor = (Implementor) messageContext.getProperty( IMPLEMENTOR );
        final Tie tie = implementor.getTie();
  StreamingHandler handler = (StreamingHandler) implementor.getTie();
  SOAPMessage request = finalMC.getMessage();
  final ServerAuthContext sAC = config_.getAuthContext(handler,request);

        boolean status = true;
  try {
      if (sAC != null) {
    status = false;
                // proceed to process message security
                status = WebServiceSecurity.validateRequest(finalMC,sAC);

    if (status) {
        messageContext.setProperty(SERVER_AUTH_CONTEXT, sAC);
    }
            }
  } catch (AuthException ae) {
      _logger.log(Level.SEVERE, "ws.error_validate_request", ae);
      throw new RuntimeException(ae);
  } finally {
      WebServiceSecurity.auditInvocation(messageContext, endpoint_, status);
        }

        if (status) {

      // only do doAsPriv if SecurityManager in effect.

      if (System.getSecurityManager() != null) {

    // on this branch, the endpoint invocation and the
    // processing of the response will be initiated from
    // within the system handler delegate. delegate returns
    // false so that dispatcher will not invoke the endpoint.

    status = false;

    try {

        Subject.doAsPrivileged
      (SecurityContext.getCurrent().getSubject(),
       new PrivilegedExceptionAction() {
          public Object run() throws Exception {
        tie.handle(finalMC);
        processResponse(finalMC);
        return null;
          }
                     }, null);
View Full Code Here

      _logger.fine("ws.processRequest");
  }

        final SOAPMessageContext finalMC = messageContext;
  Implementor implementor = (Implementor) messageContext.getProperty( IMPLEMENTOR );
        final Tie tie = implementor.getTie();
  StreamingHandler handler = (StreamingHandler) implementor.getTie();
  SOAPMessage request = finalMC.getMessage();
  final ServerAuthContext sAC = config_.getAuthContext(handler,request);

        boolean status = true;
  try {
      if (sAC != null) {
    status = false;
                // proceed to process message security
                status = WebServiceSecurity.validateRequest(finalMC,sAC);

    if (status) {
        messageContext.setProperty(SERVER_AUTH_CONTEXT, sAC);
    }
            }
  } catch (AuthException ae) {
      _logger.log(Level.SEVERE, LogUtils.ERROR_REQUEST_VALIDATION, ae);
      throw new RuntimeException(ae);
  } finally {
      WebServiceSecurity.auditInvocation(messageContext, endpoint_, status);
        }

        if (status) {

      // only do doAsPriv if SecurityManager in effect.

      if (System.getSecurityManager() != null) {

    // on this branch, the endpoint invocation and the
    // processing of the response will be initiated from
    // within the system handler delegate. delegate returns
    // false so that dispatcher will not invoke the endpoint.

    status = false;

    try {

        Subject.doAsPrivileged
      (SecurityContext.getCurrent().getSubject(),
       new PrivilegedExceptionAction() {
          public Object run() throws Exception {
        tie.handle(finalMC);
        processResponse(finalMC);
        return null;
          }
                     }, null);
View Full Code Here

    }

    private Implementor createImplementor(RuntimeEndpointInfo targetEndpoint)
        throws Exception {

        Tie tie = (Tie) targetEndpoint.getTieClass().newInstance();

        Class seiClass  = targetEndpoint.getRemoteInterface();
        Class implClass = targetEndpoint.getImplementationClass();

        Remote servant  = null;
        if( seiClass.isAssignableFrom(implClass) ) {
            // if servlet endpoint impl is a subtype of SEI, use an
            // instance as the servant.
            servant = (Remote) implClass.newInstance();
        } else {
            // Create a dynamic proxy that implements SEI (and optionally
            // ServiceLifecycle) and delegates to an instance of the
            // endpoint impl.
            Object implInstance = implClass.newInstance();

            InvocationHandler handler =
                new ServletImplInvocationHandler(implInstance);
            boolean implementsLifecycle =
                ServiceLifecycle.class.isAssignableFrom(implClass);
            Class[] proxyInterfaces = implementsLifecycle ?
                new Class[] { seiClass, ServiceLifecycle.class } :
                new Class[] { seiClass };

            servant = (Remote) Proxy.newProxyInstance
                (implClass.getClassLoader(), proxyInterfaces, handler);
        }
        tie.setTarget(servant);
       
        Implementor implementor = rpcFactory_.createImplementor(servletContext_, tie);
        implementor.init();

        return implementor;
View Full Code Here

      _logger.fine("ws.processRequest");
  }

        final SOAPMessageContext finalMC = messageContext;
  Implementor implementor = (Implementor) messageContext.getProperty( IMPLEMENTOR );
        final Tie tie = implementor.getTie();
  StreamingHandler handler = (StreamingHandler) implementor.getTie();
  SOAPMessage request = finalMC.getMessage();
  final ServerAuthContext sAC = config_.getAuthContext(handler,request);

        boolean status = true;
  try {
      if (sAC != null) {
    status = false;
                // proceed to process message security
                status = WebServiceSecurity.validateRequest(finalMC,sAC);

    if (status) {
        messageContext.setProperty(SERVER_AUTH_CONTEXT, sAC);
    }
            }
  } catch (AuthException ae) {
      _logger.log(Level.SEVERE, "ws.error_validate_request", ae);
      throw new RuntimeException(ae);
  } finally {
      WebServiceSecurity.auditInvocation(messageContext, endpoint_, status);
        }

        if (status) {

      // only do doAsPriv if SecurityManager in effect.

      if (System.getSecurityManager() != null) {

    // on this branch, the endpoint invocation and the
    // processing of the response will be initiated from
    // within the system handler delegate. delegate returns
    // false so that dispatcher will not invoke the endpoint.

    status = false;

    try {

        Subject.doAsPrivileged
      (SecurityContext.getCurrent().getSubject(),
       new PrivilegedExceptionAction() {
          public Object run() throws Exception {
        tie.handle(finalMC);
        processResponse(finalMC);
        return null;
          }
                     }, null);
View Full Code Here

TOP

Related Classes of com.sun.xml.rpc.spi.runtime.Tie

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.