Examples of IKeyAllocator


Examples of org.apache.tapestry.vlib.ejb.IKeyAllocator

     *
     **/

    protected Integer allocateKey() throws RemoteException
    {
        IKeyAllocator allocator;

        if (_keyAllocatorHome == null)
        {
            try
            {
                Context initial = new InitialContext();
                Context environment = (Context) initial.lookup("java:comp/env");

                Object raw = environment.lookup("ejb/KeyAllocator");
                _keyAllocatorHome =
                    (IKeyAllocatorHome) PortableRemoteObject.narrow(raw, IKeyAllocatorHome.class);
            }
            catch (NamingException ex)
            {
                throw new XEJBException("Unable to locate IKeyAllocatorHome.", ex);
            }
        }

        // Get a reference to *some* KeyAllocator bean ... it may be fresh,
        // or one reused from a pool.

        try
        {
            allocator = _keyAllocatorHome.create();
        }
        catch (CreateException ex)
        {
            throw new RemoteException(
                "Unable to create a KeyAllocator from " + _keyAllocatorHome + ".",
                ex);
        }

        // Finally, invoke the method that gets a key.

        return allocator.allocateKey();
    }
View Full Code Here

Examples of org.apache.tapestry.vlib.ejb.IKeyAllocator

     *
     **/

    protected Integer allocateKey() throws RemoteException
    {
        IKeyAllocator allocator;

        if (_keyAllocatorHome == null)
        {
            try
            {
                Context initial = new InitialContext();
                Context environment = (Context) initial.lookup("java:comp/env");

                Object raw = environment.lookup("ejb/KeyAllocator");
                _keyAllocatorHome =
                    (IKeyAllocatorHome) PortableRemoteObject.narrow(raw, IKeyAllocatorHome.class);
            }
            catch (NamingException ex)
            {
                throw new XEJBException("Unable to locate IKeyAllocatorHome.", ex);
            }
        }

        // Get a reference to *some* KeyAllocator bean ... it may be fresh,
        // or one reused from a pool.

        try
        {
            allocator = _keyAllocatorHome.create();
        }
        catch (CreateException ex)
        {
            throw new RemoteException(
                "Unable to create a KeyAllocator from " + _keyAllocatorHome + ".",
                ex);
        }

        // Finally, invoke the method that gets a key.

        return allocator.allocateKey();
    }
View Full Code Here

Examples of org.apache.tapestry.vlib.ejb.IKeyAllocator

     *
     **/

    protected Integer allocateKey() throws RemoteException
    {
        IKeyAllocator allocator;

        if (_keyAllocatorHome == null)
        {
            try
            {
                Context initial = new InitialContext();
                Context environment = (Context) initial.lookup("java:comp/env");

                Object raw = environment.lookup("ejb/KeyAllocator");
                _keyAllocatorHome =
                    (IKeyAllocatorHome) PortableRemoteObject.narrow(raw, IKeyAllocatorHome.class);
            }
            catch (NamingException ex)
            {
                throw new XEJBException("Unable to locate IKeyAllocatorHome.", ex);
            }
        }

        // Get a reference to *some* KeyAllocator bean ... it may be fresh,
        // or one reused from a pool.

        try
        {
            allocator = _keyAllocatorHome.create();
        }
        catch (CreateException ex)
        {
            throw new RemoteException(
                "Unable to create a KeyAllocator from " + _keyAllocatorHome + ".",
                ex);
        }

        // Finally, invoke the method that gets a key.

        return allocator.allocateKey();
    }
View Full Code Here

Examples of org.apache.tapestry.vlib.ejb.IKeyAllocator

     * Uses the KeyAllocator session bean to allocate a necessary key.
     */

    protected Integer allocateKey() throws RemoteException
    {
        IKeyAllocator allocator;

        if (_keyAllocatorHome == null)
        {
            try
            {
                Context initial = new InitialContext();
                Context environment = (Context) initial.lookup("java:comp/env");

                Object raw = environment.lookup("ejb/KeyAllocator");
                _keyAllocatorHome = (IKeyAllocatorHome) PortableRemoteObject.narrow(
                        raw,
                        IKeyAllocatorHome.class);
            }
            catch (NamingException ex)
            {
                throw new XEJBException("Unable to locate IKeyAllocatorHome.", ex);
            }
        }

        // Get a reference to *some* KeyAllocator bean ... it may be fresh,
        // or one reused from a pool.

        try
        {
            allocator = _keyAllocatorHome.create();
        }
        catch (CreateException ex)
        {
            throw new RemoteException("Unable to create a KeyAllocator from " + _keyAllocatorHome
                    + ".", ex);
        }

        // Finally, invoke the method that gets a key.

        return allocator.allocateKey();
    }
View Full Code Here

Examples of org.apache.tapestry.vlib.ejb.IKeyAllocator

     * Uses the KeyAllocator session bean to allocate a necessary key.
     */

    protected Integer allocateKey() throws RemoteException
    {
        IKeyAllocator allocator;

        if (_keyAllocatorHome == null)
        {
            try
            {
                Context initial = new InitialContext();
                Context environment = (Context) initial.lookup("java:comp/env");

                Object raw = environment.lookup("ejb/KeyAllocator");
                _keyAllocatorHome = (IKeyAllocatorHome) PortableRemoteObject.narrow(
                        raw,
                        IKeyAllocatorHome.class);
            }
            catch (NamingException ex)
            {
                throw new XEJBException("Unable to locate IKeyAllocatorHome.", ex);
            }
        }

        // Get a reference to *some* KeyAllocator bean ... it may be fresh,
        // or one reused from a pool.

        try
        {
            allocator = _keyAllocatorHome.create();
        }
        catch (CreateException ex)
        {
            throw new RemoteException("Unable to create a KeyAllocator from " + _keyAllocatorHome
                    + ".", ex);
        }

        // Finally, invoke the method that gets a key.

        return allocator.allocateKey();
    }
View Full Code Here

Examples of org.apache.tapestry.vlib.ejb.IKeyAllocator

     *
     **/

    protected Integer allocateKey() throws RemoteException
    {
        IKeyAllocator allocator;

        if (_keyAllocatorHome == null)
        {
            try
            {
                Context initial = new InitialContext();
                Context environment = (Context) initial.lookup("java:comp/env");

                Object raw = environment.lookup("ejb/KeyAllocator");
                _keyAllocatorHome =
                    (IKeyAllocatorHome) PortableRemoteObject.narrow(raw, IKeyAllocatorHome.class);
            }
            catch (NamingException ex)
            {
                throw new XEJBException("Unable to locate IKeyAllocatorHome.", ex);
            }
        }

        // Get a reference to *some* KeyAllocator bean ... it may be fresh,
        // or one reused from a pool.

        try
        {
            allocator = _keyAllocatorHome.create();
        }
        catch (CreateException ex)
        {
            throw new RemoteException(
                "Unable to create a KeyAllocator from " + _keyAllocatorHome + ".",
                ex);
        }

        // Finally, invoke the method that gets a key.

        return allocator.allocateKey();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.