[jboss-cvs] JBossAS SVN: r72243 - projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/stateless.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Apr 15 12:37:47 EDT 2008


Author: ALRubinger
Date: 2008-04-15 12:37:47 -0400 (Tue, 15 Apr 2008)
New Revision: 72243

Removed:
   projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/stateless/StatelessSessionContextDelegate.java
Modified:
   projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/stateless/StatelessSessionContextImpl.java
Log:
[EJBTHREE-1288] Remove the SLSB SessionContext Delegate, serialization not required

Deleted: projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/stateless/StatelessSessionContextDelegate.java
===================================================================
--- projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/stateless/StatelessSessionContextDelegate.java	2008-04-15 16:27:18 UTC (rev 72242)
+++ projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/stateless/StatelessSessionContextDelegate.java	2008-04-15 16:37:47 UTC (rev 72243)
@@ -1,73 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, 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.ejb3.stateless;
-
-import javax.ejb.EJBLocalObject;
-import javax.ejb.EJBObject;
-
-import org.jboss.ejb3.session.SessionBeanContext;
-import org.jboss.ejb3.session.SessionContextDelegateBase;
-
-/**
- * StatelessSessionContextDelegate
- * 
- * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
- * @version $Revision: $
- * @param <T>
- */
-public class StatelessSessionContextDelegate extends SessionContextDelegateBase<StatelessContainer>
-{
-
-   public StatelessSessionContextDelegate(SessionBeanContext<StatelessContainer> beanContext)
-   {
-      super(beanContext);
-   }
-   
-   @Override
-   public EJBLocalObject getEJBLocalObject() throws IllegalStateException
-   {
-      try
-      {
-         EJBLocalObject proxy = (EJBLocalObject) container.createProxyLocalEjb21();
-         return proxy;
-      }
-      catch (Exception e)
-      {
-         throw new IllegalStateException(e);
-      }
-   }
-   
-   @Override
-   public EJBObject getEJBObject() throws IllegalStateException
-   {
-      try
-      {
-         EJBObject proxy = (EJBObject) container.createProxyRemoteEjb21();
-         return proxy;
-      }
-      catch (Exception e)
-      {
-         throw new IllegalStateException(e);
-      }
-   }
-
-}

Modified: projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/stateless/StatelessSessionContextImpl.java
===================================================================
--- projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/stateless/StatelessSessionContextImpl.java	2008-04-15 16:27:18 UTC (rev 72242)
+++ projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/stateless/StatelessSessionContextImpl.java	2008-04-15 16:37:47 UTC (rev 72243)
@@ -21,20 +21,13 @@
  */
 package org.jboss.ejb3.stateless;
 
-import java.io.Serializable;
-import java.security.Identity;
-import java.security.Principal;
-import java.util.Properties;
-
-import javax.ejb.EJBHome;
-import javax.ejb.EJBLocalHome;
 import javax.ejb.EJBLocalObject;
 import javax.ejb.EJBObject;
 import javax.ejb.SessionContext;
-import javax.ejb.TimerService;
-import javax.transaction.UserTransaction;
-import javax.xml.rpc.handler.MessageContext;
 
+import org.jboss.ejb3.session.SessionBeanContext;
+import org.jboss.ejb3.session.SessionContextDelegateBase;
+
 /**
  * A session context that is serializable.
  * 
@@ -44,108 +37,40 @@
  * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
  * @version $Revision: 68144 $
  */
-public class StatelessSessionContextImpl implements Serializable, SessionContext
+public class StatelessSessionContextImpl extends SessionContextDelegateBase<StatelessContainer>
+      implements
+         SessionContext
 {
-   private static final long serialVersionUID = 1L;
-
-   private transient SessionContext delegate;
-
-   public StatelessSessionContextImpl(StatelessBeanContext beanContext)
+   public StatelessSessionContextImpl(SessionBeanContext<StatelessContainer> beanContext)
    {
-      assert beanContext != null : "beanContext is null";
-
-      this.delegate = new StatelessSessionContextDelegate(beanContext);
+      super(beanContext);
    }
 
-   public <T> T getBusinessObject(Class<T> businessInterface) throws IllegalStateException
-   {
-      return getDelegate().getBusinessObject(businessInterface);
-   }
-
-   protected SessionContext getDelegate()
-   {
-      return delegate;
-   }
-
+   @Override
    public EJBLocalObject getEJBLocalObject() throws IllegalStateException
    {
-      return getDelegate().getEJBLocalObject();
+      try
+      {
+         EJBLocalObject proxy = (EJBLocalObject) container.createProxyLocalEjb21();
+         return proxy;
+      }
+      catch (Exception e)
+      {
+         throw new IllegalStateException(e);
+      }
    }
 
+   @Override
    public EJBObject getEJBObject() throws IllegalStateException
    {
-      return getDelegate().getEJBObject();
+      try
+      {
+         EJBObject proxy = (EJBObject) container.createProxyRemoteEjb21();
+         return proxy;
+      }
+      catch (Exception e)
+      {
+         throw new IllegalStateException(e);
+      }
    }
-
-   public Class<?> getInvokedBusinessInterface() throws IllegalStateException
-   {
-      return getDelegate().getInvokedBusinessInterface();
-   }
-
-   public MessageContext getMessageContext() throws IllegalStateException
-   {
-      return getDelegate().getMessageContext();
-   }
-
-   @SuppressWarnings("deprecation")
-   public Identity getCallerIdentity()
-   {
-      return getDelegate().getCallerIdentity();
-   }
-
-   public Principal getCallerPrincipal()
-   {
-      return getDelegate().getCallerPrincipal();
-   }
-
-   public EJBHome getEJBHome()
-   {
-      return getDelegate().getEJBHome();
-   }
-
-   public EJBLocalHome getEJBLocalHome()
-   {
-      return getDelegate().getEJBLocalHome();
-   }
-
-   public Properties getEnvironment()
-   {
-      return getDelegate().getEnvironment();
-   }
-
-   public boolean getRollbackOnly() throws IllegalStateException
-   {
-      return getDelegate().getRollbackOnly();
-   }
-
-   public TimerService getTimerService() throws IllegalStateException
-   {
-      return getDelegate().getTimerService();
-   }
-
-   public UserTransaction getUserTransaction() throws IllegalStateException
-   {
-      return getDelegate().getUserTransaction();
-   }
-
-   @SuppressWarnings("deprecation")
-   public boolean isCallerInRole(Identity role)
-   {
-      return getDelegate().isCallerInRole(role);
-   }
-
-   public boolean isCallerInRole(String roleName)
-   {
-      return getDelegate().isCallerInRole(roleName);
-   }
-
-   public Object lookup(String name)
-   {
-      return getDelegate().lookup(name);
-   }
-
-   public void setRollbackOnly() throws IllegalStateException
-   {
-      getDelegate().setRollbackOnly();
-   }
 }




More information about the jboss-cvs-commits mailing list