Package com.sun.ejb.containers

Examples of com.sun.ejb.containers.BaseContainer$BeanContext


    private String remoteBusinessInterface;

    SerializableS1ASEJBObjectReference(long containerId, byte[] objKey,
            int keySize, String remoteBusinessInterfaceName) {
        super(containerId);
        BaseContainer container = EjbContainerUtilImpl.getInstance().getContainer(containerId);
        if (container != null) {
            this.haEnabled = container.isHAEnabled();
        }
        remoteBusinessInterface = remoteBusinessInterfaceName;
        instanceKey = new byte[keySize];
        System.arraycopy(objKey, EJBObjectOutputStream.INSTANCEKEY_OFFSET,
                instanceKey, 0, keySize);
View Full Code Here


   
    public Object createObject()
        throws IOException
    {
        Object result = null;
        BaseContainer container = EjbContainerUtilImpl.getInstance().getContainer(containerId);
        //container can be null if the app has been undeployed
        //  after this was serialized
        if (container == null) {
            _ejbLogger.log(Level.WARNING,
                               "ejb.base.io.EJBOutputStream.null_container: "
                               + debugStr);
            result = null;
        } else {
                try {
                    if( remoteBusinessInterface == null ) {
                        java.rmi.Remote reference = container.
                            createRemoteReferenceWithId(instanceKey, null);
                        result = AbstractSerializableS1ASEJBReference.
                            doRemoteRefClassLoaderConversion(reference);

                    } else {

                        String generatedRemoteIntfName = EJBUtils.
                            getGeneratedRemoteIntfName(remoteBusinessInterface);

                        java.rmi.Remote remoteRef = container.
                            createRemoteReferenceWithId(instanceKey,
                                                        generatedRemoteIntfName);

                        java.rmi.Remote newRemoteRef =
                            AbstractSerializableS1ASEJBReference.
View Full Code Here

        if( refDesc.isLocal() ) {

            EjbDescriptor target = refDesc.getEjbDescriptor();          

            BaseContainer container = EjbContainerUtilImpl.getInstance().getContainer(target.getUniqueId());

            if( refDesc.isEJB30ClientView() ) {
                GenericEJBLocalHome genericLocalHome =
                    container.getEJBLocalBusinessHome(refDesc.getEjbInterface());
                returnObject = genericLocalHome.create(refDesc.getEjbInterface());
            } else {
                returnObject = container.getEJBLocalHome();
            }

        } else {

            // For the Remote case, the only time we have to do
View Full Code Here

      return create(null, null);
   }

   protected BeanContext<?> create(Class[] initTypes, Object[] initValues)
   {
      BeanContext ctx;
      ctx = createBeanContext();
      container.pushContext(ctx);
      try
      {
         container.injectBeanContext(ctx);
View Full Code Here

      synchronized (pool)
      {
         if (!pool.isEmpty())
         {
            BeanContext bean = (BeanContext) pool.removeFirst();
            ++inUse;
            return bean;
         }
      }
      return null;
View Full Code Here

    *
    * @return Context /w instance
    */
   public BeanContext get()
   {
      BeanContext bean = acquire();
      if(bean != null)
         return bean;

      try
      {
View Full Code Here

      return bean;
   }

   public BeanContext get(Class[] initTypes, Object[] initValues)
   {
      BeanContext bean = acquire();
      if(bean != null)
         return bean;
     
      try
      {
View Full Code Here

   private void freeAll()
   {
      LinkedList clone = (LinkedList) pool.clone();
      for (int i = 0; i < clone.size(); i++)
      {
         BeanContext bc = (BeanContext) clone.get(i);
         // Clear TX so that still TX entity pools get killed as well
         discard(bc);
      }
      pool.clear();
      inUse = 0;
View Full Code Here

      inUse.getAndSet(0);
   }
  
   public BeanContext get()
   {
      BeanContext ctx = currentBeanContext.get();
      if (ctx != null)
         currentBeanContext.set(null);
      else
         ctx = create();
View Full Code Here

      return ctx;
   }

   public BeanContext get(Class[] initTypes, Object[] initValues)
   {
      BeanContext ctx = currentBeanContext.get();
      if (ctx != null)
         currentBeanContext.set(null);
      else
         ctx = create(initTypes, initValues);
View Full Code Here

TOP

Related Classes of com.sun.ejb.containers.BaseContainer$BeanContext

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.