/*
 * JBoss, the OpenSource J2EE webOS
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package org.jboss.ejb3.test.reference21_30;

import java.rmi.*;
import java.sql.Connection;

import javax.naming.*;
import javax.annotation.EJB;
import javax.annotation.EJBs;
import javax.ejb.Init;
import javax.ejb.Remote;
import javax.ejb.SessionContext;
import javax.ejb.Stateless;
import javax.sql.DataSource;

import org.jboss.annotation.ejb.RemoteBinding;
import org.jboss.annotation.security.SecurityDomain;
import org.jboss.ejb3.Container;
import org.jboss.ejb3.test.longlived.StatelessLocal;
import org.jboss.ejb3.test.stateless.CheckedStateless;
import org.jboss.logging.Logger;

/**
 * @version <tt>$Revision: 1.1.2.6 $</tt>
 * @author <a href="mailto:bdecoste@jboss.com">William DeCoste</a>
 */
@Stateless(name="GlobalSession30")
@Remote(Session30.class)
@RemoteBinding(jndiBinding = "GlobalSession30")
public class GlobalSession30Bean 
{
   private static final Logger log = Logger.getLogger(Session21Bean.class);
   
   public String access()
   {
      return "Session30";
   }
   
   public String access21()
   {
      return null;
   }
   
   public String accessLocalStateful()
   {
      return "not supported";
   }
   
   public String accessLocalStateful(String value)
   {
      return "not supported";
   }
   
   public String accessLocalStateful(String value, Integer suffix)
   {
      return "not supported";
   }
   
   public String globalAccess21()
   {
      try {
         InitialContext jndiContext = new InitialContext();
         Session21Home home = (Session21Home)jndiContext.lookup("Session21");
         Session21 session = (Session21)home.create();
         return session.access();
      } catch (Exception e)
      {
         e.printStackTrace();
         return null;
      }
   }
   
}
