Package javax.enterprise.inject

Examples of javax.enterprise.inject.CreationException


        {
            Throwable throwable = getRootException(re);
           
            if(!(throwable instanceof RuntimeException))
            {
                throw new CreationException(throwable);
            }
            throw (RuntimeException) throwable;
        }

        return instance;
View Full Code Here


            NamingEnumeration<NameClassPair> persUnits = context.list("java:openejb/PersistenceUnit");
           
            if (persUnits == null)
            {
                throw new CreationException("No PersistenceUnit found in java:openejb/PersistenceUnit!");
            }

            String shortestMatch = null;
           
            while (persUnits.hasMore())
            {
                NameClassPair puNc = persUnits.next();
               
                if (puNc.getName().startsWith(unitName))
                {
                    if (shortestMatch == null || shortestMatch.length() > puNc.getName().length())
                    {
                        shortestMatch = puNc.getName();
                    }
                }
               
            }
           
            if (shortestMatch == null)
            {
                throw new CreationException("PersistenceUnit '" + unitName + "' not found");
            }
           
            factory = (EntityManagerFactory) context.lookup("java:openejb/PersistenceUnit/" + shortestMatch);
           
           
        }
        catch (NamingException e)
        {
            throw new CreationException("PersistenceUnit '" + unitName + "' not found", e );
        }
        return clazz.cast(factory);
    }
View Full Code Here

        {
            Throwable throwable = ClassUtil.getRootException(re);
           
            if(!(throwable instanceof RuntimeException))
            {
                throw new CreationException(throwable);
            }
            throw (RuntimeException) throwable;
        }

        return instance;
View Full Code Here

            NamingEnumeration<NameClassPair> persUnits = context.list("java:openejb/PersistenceUnit");
           
            if (persUnits == null)
            {
                throw new CreationException("No PersistenceUnit found in java:openejb/PersistenceUnit!");
            }

            String shortestMatch = null;
           
            while (persUnits.hasMore())
            {
                NameClassPair puNc = persUnits.next();
               
                if (puNc.getName().startsWith(unitName))
                {
                    if (shortestMatch == null || shortestMatch.length() > puNc.getName().length())
                    {
                        shortestMatch = puNc.getName();
                    }
                }
               
            }
           
            if (shortestMatch == null)
            {
                throw new CreationException("PersistenceUnit '" + unitName + "' not found");
            }
           
            factory = (EntityManagerFactory) context.lookup("java:openejb/PersistenceUnit/" + shortestMatch);
           
           
        } catch (NamingException e) {
            throw new CreationException("PersistenceUnit '" + unitName + "' not found", e );
        }
        return clazz.cast(factory);
    }
View Full Code Here

        {
            Throwable throwable = ClassUtil.getRootException(re);
           
            if(!(throwable instanceof RuntimeException))
            {
                throw new CreationException(throwable);
            }
            throw (RuntimeException) throwable;
        }

        return instance;
View Full Code Here

        {
            Throwable throwable = getRootException(re);
           
            if(!(throwable instanceof RuntimeException))
            {
                throw new CreationException(throwable);
            }
            throw (RuntimeException) throwable;
        }

    }
View Full Code Here

        {
            Throwable throwable = getRootException(re);
           
            if(!(throwable instanceof RuntimeException))
            {
                throw new CreationException(throwable);
            }
            throw (RuntimeException) throwable;
        }

        return instance;
View Full Code Here

            NamingEnumeration<NameClassPair> persUnits = context.list("java:openejb/PersistenceUnit");
           
            if (persUnits == null)
            {
                throw new CreationException( "No PersistenceUnit found in java:openejb/PersistenceUnit!" );
            }

            String shortestMatch = null;
           
            while (persUnits.hasMore())
            {
                NameClassPair puNc = persUnits.next();
               
                if (puNc.getName().startsWith(unitName))
                {
                    if (shortestMatch == null || shortestMatch.length() > puNc.getName().length())
                    {
                        shortestMatch = puNc.getName();
                    }
                }
               
            }
           
            if (shortestMatch == null)
            {
                throw new CreationException("PersistenceUnit '" + unitName + "' not found");
            }
           
            factory = (EntityManagerFactory) context.lookup("java:openejb/PersistenceUnit/" + shortestMatch);
           
           
        } catch (NamingException e) {
            throw new CreationException("PersistenceUnit '" + unitName + "' not found", e );
        }
        return factory;
    }
View Full Code Here

        {
            Throwable throwable = getRootException(re);
           
            if(!(throwable instanceof RuntimeException))
            {
                throw new CreationException(throwable);
            }
            throw (RuntimeException) throwable;
        }

        return instance;
View Full Code Here

        {
            Throwable throwable = getRootException(re);
           
            if(!(throwable instanceof RuntimeException))
            {
                throw new CreationException(throwable);
            }
            throw (RuntimeException) throwable;
        }

    }
View Full Code Here

TOP

Related Classes of javax.enterprise.inject.CreationException

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.