Home » xml-commons-external-1.4.01-src » javax » xml » rpc » server » [javadoc | source]

    1   /*
    2    * JBoss, Home of Professional Open Source.
    3    * Copyright 2006, Red Hat Middleware LLC, and individual contributors
    4    * as indicated by the @author tags. See the copyright.txt file in the
    5    * distribution for a full listing of individual contributors.
    6    *
    7    * This is free software; you can redistribute it and/or modify it
    8    * under the terms of the GNU Lesser General Public License as
    9    * published by the Free Software Foundation; either version 2.1 of
   10    * the License, or (at your option) any later version.
   11    *
   12    * This software is distributed in the hope that it will be useful,
   13    * but WITHOUT ANY WARRANTY; without even the implied warranty of
   14    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   15    * Lesser General Public License for more details.
   16    *
   17    * You should have received a copy of the GNU Lesser General Public
   18    * License along with this software; if not, write to the Free
   19    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
   20    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
   21    */
   22   package javax.xml.rpc.server;
   23   
   24   import java.security.Principal;
   25   
   26   import javax.servlet.ServletContext;
   27   import javax.servlet.http.HttpSession;
   28   import javax.xml.rpc.handler.MessageContext;
   29   
   30   /**
   31    * This interface provides an endpoint context maintained by the underlying
   32    * servlet container based JAX-RPC runtime system. For service endpoints
   33    * deployed on a servlet container based JAX-RPC runtime system, the context
   34    * parameter in the ServiceLifecycle.init method is required to be of the Java
   35    * type javax.xml.rpc.server.ServletEndpointContext.
   36    * 
   37    * A servlet container based JAX-RPC runtime system implements the
   38    * ServletEndpointContext interface. The JAX-RPC runtime system is required to
   39    * provide appropriate session, message context, servlet context and user
   40    * principal information per method invocation on the endpoint class.
   41    * 
   42    * @author Scott.Stark@jboss.org
   43    * @author Rahul Sharma, Roberto Chinnici (javadoc)
   44    */
   45   public interface ServletEndpointContext
   46   {
   47      /**
   48       * The getHttpSession method returns the current HTTP session (as a javax.servlet.http.HTTPSession).
   49       * When invoked by the service endpoint within a remote method implementation, the getHttpSession returns the HTTP
   50       * session associated currently with this method invocation. This method returns null if there is no HTTP session
   51       * currently active and associated with this service endpoint. An endpoint class should not rely on an active HTTP
   52       * session being always there; the underlying JAX-RPC runtime system is responsible for managing whether or not there
   53       * is an active HTTP session.
   54       *
   55       * The getHttpSession method throws JAXRPCException if invoked by an non HTTP bound endpoint.
   56       *
   57       * @return The HTTP session associated with the current invocation or null if there is no active session.
   58       */
   59      public HttpSession getHttpSession();
   60   
   61      /**
   62       * The method getMessageContext returns the MessageContext targeted for this endpoint instance.
   63       * This enables the service endpoint instance to acccess the MessageContext propagated by request HandlerChain
   64       * (and its contained Handler instances) to the target endpoint instance and to share any SOAP message processing related context.
   65       * The endpoint instance can access and manipulate the MessageContext and share the SOAP message processing related context with the response HandlerChain.
   66       *
   67       * @return MessageContext; If there is no associated MessageContext, this method returns null.
   68       */
   69      public MessageContext getMessageContext();
   70   
   71      /**
   72       * The method getServletContext returns the ServletContext associated with the web application that contain this endpoint.
   73       * According to the Servlet specification, There is one context per web application (installed as a WAR) per JVM .
   74       * A servlet based service endpoint is deployed as part of a web application.
   75       * @return ServletContext
   76       */
   77      public ServletContext getServletContext();
   78   
   79      /**
   80       * Returns a java.security.Principal instance that contains the name of the authenticated user for the current method
   81       * invocation on the endpoint instance. This method returns null if there is no associated principal yet.
   82       * The underlying JAX-RPC runtime system takes the responsibility of providing the appropriate authenticated principal
   83       * for a remote method invocation on the service endpoint instance.
   84       *
   85       * @return A java.security.Principal for the authenticated principal associated with the current invocation on the
   86       * servlet endpoint instance; Returns null if there no authenticated user associated with a method invocation.
   87   
   88       */
   89      public Principal getUserPrincipal();
   90   
   91      /**
   92       * Returns a boolean indicating whether the authenticated user for the current method invocation on the endpoint
   93       * instance is included in the specified logical "role".
   94       *
   95       * @param role a String specifying the name of the role
   96       * @return a boolean indicating whether the authenticated user associated with the current method invocation belongs
   97       * to a given role; false if the user has not been authenticated
   98       */
   99      public boolean isUserInRole(String role);
  100   }

Home » xml-commons-external-1.4.01-src » javax » xml » rpc » server » [javadoc | source]