Package org.ow2.util.ee.deploy.api.deployer

Examples of org.ow2.util.ee.deploy.api.deployer.DeployerException


            // Resolve container
            try {
                container.resolve();
            } catch (EZBContainerException e) {
                throw new DeployerException("Cannot resolve the container '" + container.getArchive() + "'.", e);
            }
        }

        // Start containers
        for (EZBContainer container : containers) {
View Full Code Here


     * @param deployable the deployable that needs to be deployed
     * @throws DeployerException if this deployable is not supported.
     */
    private void checkSupportedDeployable(final IDeployable deployable) throws DeployerException {
        if (!(deployable instanceof EARDeployable || deployable instanceof EJBDeployable)) {
            throw new DeployerException("The deployable '" + deployable + "' is not supported by this deployer");
        }
    }
View Full Code Here

    public JettyDeployer() throws DeployerException {
        super();

        // Check if this deployer has been initialized correctly
        if (jettyServer == null) {
            throw new DeployerException("This deployer has not be initialized correctly as the Jetty server is null");
        }

        // Load the class
        this.webAppContextClass = loadClass(WEB_APP_CONTEXT_CLASS_NAME, getClassLoader());

        // get Handler collection from jetty
        Method getChildHandlerByClassMethod = getMethod(jettyServer.getClass(), GET_CHILD_HANDLER_METHOD_NAME, Class.class);
        Class handlerCollectionClass = loadClass(HANDLER_COLLECTION_CLASS_NAME, getClassLoader());
        Object handlerCollection = invoke(getChildHandlerByClassMethod, jettyServer, handlerCollectionClass);
        if (handlerCollection == null) {
            throw new DeployerException("No handler collection has been defined on the jetty server object '" + jettyServer
                    + "'.");
        }
        this.contexts = invoke(getChildHandlerByClassMethod, handlerCollection, handlerCollectionClass);

        // add/remove/get Handler method
View Full Code Here

            // invoke setters
            // for the URL of the war file
            try {
                invoke(this.setWarMethod, webAppContext, war.getArchive().getURL().getPath());
            } catch (ArchiveException e) {
                throw new DeployerException("Cannot get URL from the archive '" + war.getArchive() + "'.", e);
            }
            // for defining the name of the context
            invoke(this.setContextPathMethod, webAppContext, "/" + war.getContextRoot());

            // Java delegation model = true
View Full Code Here

     * @param deployable the deployable that needs to be deployed
     * @throws DeployerException if this deployable is not supported.
     */
    private void checkSupportedDeployable(final IDeployable deployable) throws DeployerException {
        if (!(deployable instanceof EARDeployable || deployable instanceof EJBDeployable)) {
            throw new DeployerException("The deployable '" + deployable + "' is not supported by this deployer");
        }
    }
View Full Code Here

            }
        }

        // Context not found
        if (context == null) {
            throw new DeployerException("Unable to find a context with the name '" + contextRoot
                    + "' for the War deployable '" + warDeployable + "'.");
        }

        // Stop the context
        invoke(this.stopContextMethod, context);
View Full Code Here

    public static void setContextEvent(final ServletContextEvent contextEvent) throws DeployerException {

        // First, try to get the source on the given context event
        Object source = contextEvent.getSource();
        if (source == null) {
            throw new DeployerException("No source object on the given contextEvent '" + contextEvent + "'.");
        }

        // try to get getContextHandler method on this source object
        Method getContextHandlerMethod = getMethod(source.getClass(), "getContextHandler");
        if (getContextHandlerMethod == null) {
            throw new DeployerException("No getContextHandler method was found on the '" + source + "' object");
        }

        // get Handler
        Object contextHandler = invoke(getContextHandlerMethod, source);
        if (contextHandler == null) {
            throw new DeployerException("No context handler object was returned from the '" + source + "' object");
        }

        // get the getServer method
        Method getServerMethod = getMethod(contextHandler.getClass(), "getServer");
        if (getServerMethod == null) {
            throw new DeployerException("No getServer method was found on the '" + contextHandler + "' object");
        }

        // Set the jetty server
        jettyServer = invoke(getServerMethod, contextHandler);

        // No server ?
        if (jettyServer == null) {
            throw new DeployerException("No Jetty server found on the servlet context event '" + contextEvent + "'.");
        }

    }
View Full Code Here

        List<URL> urls = new ArrayList<URL>();
        for (EJBDeployable<?> ejb : ejbs) {
            try {
                urls.add(ejb.getArchive().getURL());
            } catch (ArchiveException e) {
                throw new DeployerException("Cannot get the URL for the Archive '" + ejb.getArchive() + "'.", e);
            }
        }
        for (LibDeployable lib : libs) {
            try {
                urls.add(lib.getArchive().getURL());
            } catch (ArchiveException e) {
                throw new DeployerException("Cannot get the URL for the Archive '" + lib.getArchive() + "'.", e);

            }
        }

        // Create classloader with these URLs
View Full Code Here

        EZBContainer container = getEmbedded().createContainer(ejbDeployable);
        try {
            container.start();
        } catch (EZBContainerException e) {
            getEmbedded().removeContainer(container);
            throw new DeployerException("Cannot deploy the given EJB '" + ejbDeployable + "'.", e);
        }
    }
View Full Code Here

     */
    protected static Object newInstance(final Class clazz) throws DeployerException {
        try {
            return clazz.newInstance();
        } catch (InstantiationException e) {
            throw new DeployerException("Cannot make an instance of the class '" + clazz + "'.", e);
        } catch (IllegalAccessException e) {
           throw new DeployerException("Cannot make an instance of the class '" + clazz + "'.", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.ow2.util.ee.deploy.api.deployer.DeployerException

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.