Examples of VirtualServer


Examples of com.sun.enterprise.config.serverbeans.VirtualServer

            final ContainerMapper containerMapper = new ContainerMapper(grizzlyService, this);
            containerMapper.setMapper(mapper);
            containerMapper.setDefaultHost(http.getDefaultVirtualServer());
            containerMapper.configureMapper();

            VirtualServer vs = null;
            String webAppRootPath = null;

            final Collection<VirtualServer> list = grizzlyService.getHabitat().getAllServices(VirtualServer.class);
            final String vsName = http.getDefaultVirtualServer();
            for (final VirtualServer virtualServer : list) {
                if (virtualServer.getId().equals(vsName)) {
                    vs = virtualServer;
                    webAppRootPath = vs.getDocroot();

                    if (!grizzlyService.hasMapperUpdateListener() && vs.getProperty() != null
                            && !vs.getProperty().isEmpty()) {
                        for (final Property p : vs.getProperty()) {
                            final String propertyName = p.getName();
                            if (propertyName.startsWith("alternatedocroot")) {
                                String value = p.getValue();
                                String[] mapping = value.split(" ");
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.VirtualServer

        HttpService httpService = config.getHttpService();
        if (!(verifyUniqueName(report, networkConfig) && verifyUniquePort(report, networkConfig)
            && verifyDefaultVirtualServer(report))) {
            return;
        }
        VirtualServer vs = httpService.getVirtualServerByName(defaultVirtualServer);
        boolean listener = false;
        boolean protocol = false;
        boolean transport = false;
        try {
            transport = createOrGetTransport(null);
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.VirtualServer

            ConfigSupport.apply(new SingleConfigCode<HttpService>() {
                public Object run(HttpService param) throws PropertyVetoException, TransactionFailure {
                    String docroot = "${com.sun.aas.instanceRoot}/docroot";    // default
                    String accessLog = "${com.sun.aas.instanceRoot}/logs/access";    // default

                    VirtualServer newVirtualServer = param.createChild(VirtualServer.class);
                    newVirtualServer.setId(virtualServerId);
                    newVirtualServer.setHosts(hosts);
                    newVirtualServer.setNetworkListeners(networkListeners);
                    newVirtualServer.setDefaultWebModule(defaultWebModule);
                    newVirtualServer.setState(state);
                    newVirtualServer.setLogFile(logFile);
                    // 1. add properties
                    // 2. check if the access-log and docroot properties have
                    //    been specified. We will use with default
                    //    values if the properties have not been specified.
                    if (properties != null) {
                        for (Map.Entry entry : properties.entrySet()) {
                            String pn = (String) entry.getKey();
                            String pv = (String)entry.getValue();

                            if ("docroot".equals(pn)) {
                                docroot = pv;
                            } else if ("accesslog".equals(pn)) {
                                accessLog = pv;
                            } else {
                                Property property = newVirtualServer.createChild(Property.class);
                                property.setName(pn);
                                property.setValue(pv);
                                newVirtualServer.getProperty().add(property);
                            }
                        }
                    }

                    newVirtualServer.setDocroot(docroot);
                    newVirtualServer.setAccessLog(accessLog);

                    param.getVirtualServer().add(newVirtualServer);
                    return newVirtualServer;
                }
            }, httpService);
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.VirtualServer

        ActionReport report = context.getActionReport();
        NetworkListeners networkListeners = config.getNetworkConfig().getNetworkListeners();
        try {
            if (findListener(networkListeners, report)) {
                final Protocol httpProtocol = listenerToBeRemoved.findHttpProtocol();
                final VirtualServer virtualServer = config.getHttpService().getVirtualServerByName(
                        httpProtocol.getHttp().getDefaultVirtualServer());

                ConfigSupport.apply(new ConfigCode() {
                    public Object run(ConfigBeanProxy... params) throws PropertyVetoException {
                        final NetworkListeners listeners = (NetworkListeners) params[0];
                        final VirtualServer server = (VirtualServer) params[1];
                        listeners.getNetworkListener().remove(listenerToBeRemoved);
                        server.removeNetworkListener(listenerToBeRemoved.getName());
                        return listenerToBeRemoved;
                    }
                }, networkListeners, virtualServer);

            }
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.VirtualServer

            return;
        }
        try {
            NetworkListener ls = networkConfig.getNetworkListener(listenerId);
            final String name = ls.getProtocol();
            VirtualServer vs = config.getHttpService()
                .getVirtualServerByName(ls.findHttpProtocol().getHttp().getDefaultVirtualServer());
            ConfigSupport.apply(new DeleteNetworkListener(), networkConfig.getNetworkListeners());
            ConfigSupport.apply(new UpdateVirtualServer(), vs);
            cleanUp(name);
            report.setActionExitCode(ExitCode.SUCCESS);
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.VirtualServer

    private List<AddressInfo> getAddressInfoFromVirtualServers(Collection<String> virtualServers) {
        List<AddressInfo> addressInfos = new ArrayList<AddressInfo>();
        List<NetworkListener> networkListenerList = config.getNetworkConfig().getNetworkListeners().getNetworkListener();

        for (String vs : virtualServers) {
            VirtualServer virtualServer =
                config.getHttpService().getVirtualServerByName(vs);
            if (virtualServer == null) {
                // non-existent virtual server
                LOGGER.log(Level.WARNING, KernelLoggerInfo.grizzlyNonExistentVS, vs);
                continue;
            }
            String vsNetworkListeners = virtualServer.getNetworkListeners();
            List<String> vsNetworkListenerList =
                StringUtils.parseStringList(vsNetworkListeners, ",");
            if (vsNetworkListenerList != null && !vsNetworkListenerList.isEmpty()) {
                for (String vsNetworkListener : vsNetworkListenerList) {
                    for (NetworkListener networkListener : networkListenerList) {
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.VirtualServer

            ConfigSupport.apply(new SingleConfigCode<HttpService>() {
                public Object run(HttpService param) throws PropertyVetoException, TransactionFailure {
                    String docroot = "${com.sun.aas.instanceRoot}/docroot";    // default
                    String accessLog = "${com.sun.aas.instanceRoot}/logs/access";    // default

                    VirtualServer newVirtualServer = param.createChild(VirtualServer.class);
                    newVirtualServer.setId(virtualServerId);
                    newVirtualServer.setHosts(hosts);
                    newVirtualServer.setNetworkListeners(networkListeners);
                    newVirtualServer.setDefaultWebModule(defaultWebModule);
                    newVirtualServer.setState(state);
                    newVirtualServer.setLogFile(logFile);
                    // 1. add properties
                    // 2. check if the access-log and docroot properties have
                    //    been specified. We will use with default
                    //    values if the properties have not been specified.
                    if (properties != null) {
                        for (Map.Entry entry : properties.entrySet()) {
                            String pn = (String) entry.getKey();
                            String pv = (String)entry.getValue();

                            if ("docroot".equals(pn)) {
                                docroot = pv;
                            } else if ("accesslog".equals(pn)) {
                                accessLog = pv;
                            } else {
                                Property property = newVirtualServer.createChild(Property.class);
                                property.setName(pn);
                                property.setValue(pv);
                                newVirtualServer.getProperty().add(property);
                            }
                        }
                    }

                    newVirtualServer.setDocroot(docroot);
                    newVirtualServer.setAccessLog(accessLog);

                    param.getVirtualServer().add(newVirtualServer);
                    return newVirtualServer;
                }
            }, httpService);
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.VirtualServer

    private List<AddressInfo> getAddressInfoFromVirtualServers(Collection<String> virtualServers) {
        List<AddressInfo> addressInfos = new ArrayList<AddressInfo>();
        List<NetworkListener> networkListenerList = config.getNetworkConfig().getNetworkListeners().getNetworkListener();

        for (String vs : virtualServers) {
            VirtualServer virtualServer =
                config.getHttpService().getVirtualServerByName(vs);
            if (virtualServer == null) {
                // non-existent virtual server
                LOGGER.log(Level.WARNING, KernelLoggerInfo.grizzlyNonExistentVS, vs);
                continue;
            }
            String vsNetworkListeners = virtualServer.getNetworkListeners();
            List<String> vsNetworkListenerList =
                StringUtils.parseStringList(vsNetworkListeners, ",");
            if (vsNetworkListenerList != null && !vsNetworkListenerList.isEmpty()) {
                for (String vsNetworkListener : vsNetworkListenerList) {
                    for (NetworkListener networkListener : networkListenerList) {
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.VirtualServer

        ActionReport report = context.getActionReport();
        NetworkListeners networkListeners = config.getNetworkConfig().getNetworkListeners();
        try {
            if (findListener(networkListeners, report)) {
                final Protocol httpProtocol = listenerToBeRemoved.findHttpProtocol();
                final VirtualServer virtualServer = config.getHttpService().getVirtualServerByName(
                        httpProtocol.getHttp().getDefaultVirtualServer());

                ConfigSupport.apply(new ConfigCode() {
                    public Object run(ConfigBeanProxy... params) throws PropertyVetoException {
                        final NetworkListeners listeners = (NetworkListeners) params[0];
                        final VirtualServer server = (VirtualServer) params[1];
                        listeners.getNetworkListener().remove(listenerToBeRemoved);
                        server.removeNetworkListener(listenerToBeRemoved.getName());
                        return listenerToBeRemoved;
                    }
                }, networkListeners, virtualServer);

            }
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.VirtualServer

            return;
        }
        try {
            NetworkListener ls = networkConfig.getNetworkListener(listenerId);
            final String name = ls.getProtocol();
            VirtualServer vs = config.getHttpService()
                .getVirtualServerByName(ls.findHttpProtocol().getHttp().getDefaultVirtualServer());
            ConfigSupport.apply(new DeleteNetworkListener(), networkConfig.getNetworkListeners());
            ConfigSupport.apply(new UpdateVirtualServer(), vs);
            cleanUp(name);
            report.setActionExitCode(ExitCode.SUCCESS);
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.