Author: alessio.soldano(a)jboss.com
Date: 2009-01-27 13:34:59 -0500 (Tue, 27 Jan 2009)
New Revision: 9129
Removed:
spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/WebServiceContextEJB.java
spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/WebServiceContextJSE.java
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/ExtensibleWebServiceContext.java
Log:
[JBWS-2491] Removing NotImplementedExceptions from ExtensibleWebServiceContext + fixing
API
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/ExtensibleWebServiceContext.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/ExtensibleWebServiceContext.java 2009-01-27
18:25:31 UTC (rev 9128)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/ExtensibleWebServiceContext.java 2009-01-27
18:34:59 UTC (rev 9129)
@@ -25,7 +25,6 @@
import javax.xml.ws.EndpointReference;
import javax.xml.ws.WebServiceContext;
-import javax.xml.ws.WebServiceException;
import javax.xml.ws.handler.MessageContext;
import org.jboss.wsf.spi.deployment.AbstractExtensible;
@@ -38,6 +37,7 @@
* class using the Resource annotation.
*
* @author Thomas.Diesler(a)jboss.com
+ * @author alessio.soldano(a)jboss.com
* @since 03-May-2006
*/
public abstract class ExtensibleWebServiceContext extends AbstractExtensible implements
WebServiceContext
@@ -58,23 +58,7 @@
public abstract boolean isUserInRole(String role);
- public EndpointReference getEndpointReference()
- {
- throw new WebServiceException("Not implemented");
- }
+ public abstract EndpointReference getEndpointReference(Element... arg0);
- public <T extends EndpointReference> T getEndpointReference(Class<T>
arg0)
- {
- throw new WebServiceException("Not implemented");
- }
-
- public EndpointReference getEndpointReference(Element... arg0)
- {
- throw new WebServiceException("Not implemented");
- }
-
- public <T extends EndpointReference> T getEndpointReference(Class<T> arg0,
Element... arg1)
- {
- throw new WebServiceException("Not implemented");
- }
+ public abstract <T extends EndpointReference> T
getEndpointReference(Class<T> arg0, Element... arg1);
}
Deleted: spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/WebServiceContextEJB.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/WebServiceContextEJB.java 2009-01-27
18:25:31 UTC (rev 9128)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/WebServiceContextEJB.java 2009-01-27
18:34:59 UTC (rev 9129)
@@ -1,60 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.wsf.spi.invocation;
-
-import org.jboss.wsf.spi.invocation.ExtensibleWebServiceContext;
-import org.w3c.dom.Element;
-
-import java.security.Principal;
-import java.util.Collection;
-
-import javax.ejb.EJBContext;
-import javax.xml.ws.EndpointReference;
-import javax.xml.ws.handler.MessageContext;
-
-/**
- * A WebServiceContext implementation that delegates to the EJBContext.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 23-Jan-2007
- */
-public class WebServiceContextEJB extends ExtensibleWebServiceContext
-{
- public WebServiceContextEJB(MessageContext msgContext)
- {
- super(msgContext);
- }
-
- public Principal getUserPrincipal()
- {
- EJBContext ejbContext = getAttachment(EJBContext.class);
- Principal principal = ejbContext.getCallerPrincipal();
- return principal;
- }
-
- public boolean isUserInRole(String role)
- {
- EJBContext ejbContext = getAttachment(EJBContext.class);
- boolean isUserInRole = ejbContext.isCallerInRole(role);
- return isUserInRole;
- }
-}
Deleted: spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/WebServiceContextJSE.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/WebServiceContextJSE.java 2009-01-27
18:25:31 UTC (rev 9128)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/WebServiceContextJSE.java 2009-01-27
18:34:59 UTC (rev 9129)
@@ -1,60 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.wsf.spi.invocation;
-
-import java.security.Principal;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.xml.ws.handler.MessageContext;
-
-/**
- * A WebServiceContext implementation that delegates to the HttpServletRequest.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 23-Jan-2007
- */
-public class WebServiceContextJSE extends ExtensibleWebServiceContext
-{
- private HttpServletRequest httpRequest;
-
- public WebServiceContextJSE(MessageContext msgContext)
- {
- super(msgContext);
- httpRequest = (HttpServletRequest)msgContext.get(MessageContext.SERVLET_REQUEST);
- if (httpRequest == null)
- throw new IllegalStateException("Cannot obtain HTTPServletRequest from
message context");
- }
-
- @Override
- public Principal getUserPrincipal()
- {
- Principal principal = httpRequest.getUserPrincipal();
- return principal;
- }
-
- @Override
- public boolean isUserInRole(String role)
- {
- boolean isUserInRole = httpRequest.isUserInRole(role);
- return isUserInRole;
- }
-}