Package javax.ejb

Examples of javax.ejb.EJBHome


     * @return an EJB metadata object.
     * @throws RemoteException if metadata object cannot be built.
     */
    private EJBMetaData handleGetEJBMetadata(final Object proxy) throws RemoteException {
        // EJBHome is the proxy object
        EJBHome ejbHome = (EJBHome) proxy;

        // Classloader
        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();

        // Home interface
View Full Code Here


         RemoteBinding remoteBindingAnnotation = this.getAnnotation(RemoteBinding.class);
         if (remoteBindingAnnotation != null)
            homeHandle = new HomeHandleImpl(ProxyFactoryHelper.getHomeJndiName(this));

         EJBHome ejbHome = homeHandle.getEJBHome();

         InvocationResponse response = marshallResponse(statefulInvocation, ejbHome, null);
         return response;
      }
      else if (unadvisedMethod.getName().equals("getPrimaryKey"))
View Full Code Here

         RemoteBinding remoteBindingAnnotation = this.getAnnotation(RemoteBinding.class);
         if (remoteBindingAnnotation != null)
            homeHandle = new HomeHandleImpl(ProxyFactoryHelper.getHomeJndiName(this));

         EJBHome ejbHome = homeHandle.getEJBHome();

         InvocationResponse response = marshallResponse(statefulInvocation, ejbHome, null);
         return response;
      }
      else if (unadvisedMethod.getName().equals("getPrimaryKey"))
View Full Code Here

         InvocationResponse response = new InvocationResponse(null);
         return response;
      }
      else if (unadvisedMethod.getName().equals("getEJBHome"))
      {
         EJBHome ejbHome;
         if(CurrentRemoteProxyFactory.isSet())
         {
            ejbHome = CurrentRemoteProxyFactory.get(EJB2RemoteProxyFactory.class).createHome();
         }
         else
View Full Code Here

    }

    public void testRemoteInterface() throws Exception {

        InitialContext ctx = new InitialContext();
        EJBHome home = (EJBHome) ctx.lookup("WidgetBeanRemoteHome");
        assertNotNull("home", home);
        assertTrue("home should be an instance of WidgetHome", home instanceof WidgetHome);
        CrossClassLoaderProxyTestObject.widgetHome = (WidgetHome) home;
        CrossClassLoaderProxyTestObject proxyTestObject = new CrossClassLoaderProxyTestObject();
        proxyTestObject.testRemoteInterface();
View Full Code Here

            assertFalse(WidgetRemote.class.equals(widgetRemoteClass));

            Object testObject = testObjectClass.newInstance();

            InitialContext ctx = new InitialContext();
            EJBHome rawHome = (EJBHome) ctx.lookup("WidgetBeanRemoteHome");
           
            EJBHome home = (EJBHome) copy(rawHome);
            assertNotNull("home", home);
            assertEquals(widgetHomeClass.getClassLoader(), home.getClass().getClassLoader());
            assertTrue(widgetHomeClass.isAssignableFrom(home.getClass()));

            testObjectClass.getField("widgetHome").set(testObject, home);

            testObjectClass.getMethod("testRemoteInterface").invoke(testObject);
        } finally {
View Full Code Here

    public EJBHome returnEJBHome(EJBHome data) {
        return data;
    }
   
    public EJBHome returnEJBHome() throws javax.ejb.EJBException{
        EJBHome data = null;

        try{
        InitialContext ctx = new InitialContext();

        data = (EJBHome)ctx.lookup("java:comp/env/stateless/rmi-iiop/home");
View Full Code Here

    /**
     * A method to test retrieving the EJBHome interface of a session bean using its EJBObject reference.
     */
    public void test01_getEjbHome() {
        try {
            EJBHome home = ejbObject.getEJBHome();
            assertNotNull("The EJBHome is null", home);
        } catch (Exception e) {
            fail("Received Exception " + e.getClass() + " : " + e.getMessage());
        }
    }
View Full Code Here

        handleDelegate.writeEJBHome(getEJBHome(), out);
    }

    private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
        HandleDelegate handleDelegate = getHandleDelegate();
        EJBHome home = handleDelegate.readEJBHome(in);

        try {
            ior = getOrb().object_to_string((org.omg.CORBA.Object) home);
        } catch (Exception e) {
            throw new RemoteException("Unable to convert object to IOR", e);
View Full Code Here

    public EJBHome getEJBHome(ProxyInfo proxyInfo) {
        try {
            RefGenerator refGenerator = AdapterWrapper.getRefGenerator((String) proxyInfo.getDeploymentInfo().getDeploymentID());
            org.omg.CORBA.Object home = refGenerator.genHomeReference();
            EJBHome ejbHome = (EJBHome) PortableRemoteObject.narrow(home, EJBHome.class);
            return ejbHome;
        } catch (Throwable e) {
            throw new org.omg.CORBA.MARSHAL(e.getClass().getName() + " thrown while marshaling the reply: " + e.getMessage(), 0, org.omg.CORBA.CompletionStatus.COMPLETED_YES);
        }
    }
View Full Code Here

TOP

Related Classes of javax.ejb.EJBHome

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.