Package org.glassfish.embeddable

Examples of org.glassfish.embeddable.GlassFishException


        throws GlassFishException {

        if (listeners.contains(webListener)) {
            listeners.remove(webListener);
        } else {
            throw new GlassFishException(new ConfigException(
                    "Connector with name '" + webListener.getId()+"' does not exsits"));
        }

        removeListener(webListener.getId());
View Full Code Here


                    param.getVirtualServer().add(newVirtualServer);
                    return newVirtualServer;
                }
            }, httpService);
        } catch (Exception ex) {
            throw new GlassFishException(ex);
        }

        if ((webListeners != null) && (!webListeners.isEmpty())) {
            for (WebListener listener : webListeners) {
                if (getWebListener(listener.getId())==null) {
                    addWebListener(listener, virtualServer.getID());
                }
            }
        }

        vs = (com.sun.enterprise.web.VirtualServer) engine.findChild(id);
        if (vs != null) {
            if (log.isLoggable(Level.INFO)) {
                log.info("Added virtual server " + id +
                        " docroot " + docRoot + " networklisteners " + nl);
            }
            if (virtualServer instanceof VirtualServerFacade) {
                ((VirtualServerFacade)virtualServer).setVirtualServer(vs);
            }
            vs.setNetworkListenerNames(names.toArray(new String[names.size()]));
        } else {
            log.severe("Could not add virtual server "+id);
            throw new GlassFishException(
                    new Exception("Cannot add virtual server " + id));

        }
       
    }
View Full Code Here

    public void addContext(Context context, String contextRoot)
        throws ConfigException, GlassFishException {
        if (vs != null) {
            vs.addContext(context, contextRoot);
        } else {
            throw new GlassFishException("Virtual server "+id+" has not been added");
        }
    }
View Full Code Here

    public void removeContext(Context context)
            throws GlassFishException {
        if (vs != null) {
            vs.removeContext(context);
        } else {
            throw new GlassFishException("Virtual server "+id+" has not been added");
        }
    }
View Full Code Here

    public String deploy(URI archive, String... params) throws GlassFishException {
        File file;
        try {
            file = convertToFile(archive);
        } catch (IOException e) {
            throw new GlassFishException("Unable to make a file out of " + archive, e);
        }
        return deploy(file, params);
    }
View Full Code Here

                extractPayload(outboundPayload, actionReport, retrieve);
            }
           
            return actionReport.getResultType(String.class);
        } catch (CommandException e) {
            throw new GlassFishException(e);
        }
    }
View Full Code Here

    @Override
    public String deploy(InputStream is, String... params) throws GlassFishException {
        try {
            return deploy(createFile(is), params);
        } catch (IOException e) {
            throw new GlassFishException(e);
        }
    }
View Full Code Here

        CommandExecutorImpl executer = habitat.getService(CommandExecutorImpl.class);
        try {
            ActionReport actionReport = executer.executeCommand("undeploy", newParams);
            actionReport.writeReport(System.out);
        } catch (CommandException e) {
            throw new GlassFishException(e);
        } catch (IOException e) {
            throw new GlassFishException(e);
        }
    }
View Full Code Here

            CommandExecutorImpl executer = habitat.getService(CommandExecutorImpl.class);
            ActionReport report = executer.executeCommand("list-components");
            Properties props = report.getTopMessagePart().getProps();
            return new ArrayList<String>(props.stringPropertyNames());
        } catch (Exception e) {
            throw new GlassFishException(e);
        }
    }
View Full Code Here

        } catch (Exception ex) {
            if (deployment!=null && deploymentContext!=null) {
                deploymentContext.clean();
            }
            throw new GlassFishException(ex);
        }

    }
View Full Code Here

TOP

Related Classes of org.glassfish.embeddable.GlassFishException

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.