Search in sources :

Example 6 with Config

use of com.sun.enterprise.config.serverbeans.Config in project Payara by payara.

the class ListProtocolFilters method execute.

public void execute(AdminCommandContext context) {
    Target targetUtil = services.getService(Target.class);
    Config newConfig = targetUtil.getConfig(target);
    if (newConfig != null) {
        config = newConfig;
    }
    final ActionReport report = context.getActionReport();
    Protocol protocol = config.getNetworkConfig().getProtocols().findProtocol(protocolName);
    if (protocol != null) {
        final ProtocolChain chain = protocol.getProtocolChainInstanceHandler().getProtocolChain();
        if (chain != null) {
            for (ProtocolFilter filter : chain.getProtocolFilter()) {
                report.getTopMessagePart().addChild().setMessage(filter.getName());
            }
        }
    }
    report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
}
Also used : Target(org.glassfish.internal.api.Target) CommandTarget(org.glassfish.config.support.CommandTarget) Config(com.sun.enterprise.config.serverbeans.Config) ProtocolChain(org.glassfish.grizzly.config.dom.ProtocolChain) ActionReport(org.glassfish.api.ActionReport) Protocol(org.glassfish.grizzly.config.dom.Protocol) ProtocolFilter(org.glassfish.grizzly.config.dom.ProtocolFilter)

Example 7 with Config

use of com.sun.enterprise.config.serverbeans.Config in project Payara by payara.

the class ListProtocolFinders method execute.

public void execute(AdminCommandContext context) {
    Target targetUtil = services.getService(Target.class);
    Config newConfig = targetUtil.getConfig(target);
    if (newConfig != null) {
        config = newConfig;
    }
    final ActionReport report = context.getActionReport();
    Protocol protocol = config.getNetworkConfig().getProtocols().findProtocol(protocolName);
    if (protocol != null) {
        final PortUnification pu = protocol.getPortUnification();
        if (pu != null) {
            for (ProtocolFinder finder : pu.getProtocolFinder()) {
                report.getTopMessagePart().addChild().setMessage(finder.getName());
            }
        }
    }
    report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
}
Also used : Target(org.glassfish.internal.api.Target) CommandTarget(org.glassfish.config.support.CommandTarget) PortUnification(org.glassfish.grizzly.config.dom.PortUnification) Config(com.sun.enterprise.config.serverbeans.Config) ActionReport(org.glassfish.api.ActionReport) Protocol(org.glassfish.grizzly.config.dom.Protocol) ProtocolFinder(org.glassfish.grizzly.config.dom.ProtocolFinder)

Example 8 with Config

use of com.sun.enterprise.config.serverbeans.Config in project Payara by payara.

the class ListTransports method execute.

/**
 * Executes the command with the command parameters passed as Properties where the keys are the paramter names and
 * the values the parameter values
 *
 * @param context information
 */
public void execute(AdminCommandContext context) {
    Target targetUtil = services.getService(Target.class);
    Config newConfig = targetUtil.getConfig(target);
    if (newConfig != null) {
        config = newConfig;
    }
    final ActionReport report = context.getActionReport();
    List<Transport> list = config.getNetworkConfig().getTransports().getTransport();
    for (Transport transport : list) {
        report.getTopMessagePart().addChild().setMessage(transport.getName());
    }
    report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
}
Also used : Target(org.glassfish.internal.api.Target) CommandTarget(org.glassfish.config.support.CommandTarget) Config(com.sun.enterprise.config.serverbeans.Config) ActionReport(org.glassfish.api.ActionReport) Transport(org.glassfish.grizzly.config.dom.Transport)

Example 9 with Config

use of com.sun.enterprise.config.serverbeans.Config in project Payara by payara.

the class ListVirtualServers method execute.

/**
 * Executes the command with the command parameters passed as Properties where the keys are the paramter names and
 * the values the parameter values
 *
 * @param context information
 */
public void execute(AdminCommandContext context) {
    Target targetUtil = services.getService(Target.class);
    Config newConfig = targetUtil.getConfig(target);
    if (newConfig != null) {
        config = newConfig;
    }
    ActionReport report = context.getActionReport();
    List<VirtualServer> list = config.getHttpService().getVirtualServer();
    for (VirtualServer virtualServer : list) {
        report.getTopMessagePart().addChild().setMessage(virtualServer.getId());
    }
    report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
}
Also used : Target(org.glassfish.internal.api.Target) Config(com.sun.enterprise.config.serverbeans.Config) ActionReport(org.glassfish.api.ActionReport) VirtualServer(com.sun.enterprise.config.serverbeans.VirtualServer)

Example 10 with Config

use of com.sun.enterprise.config.serverbeans.Config in project Payara by payara.

the class WeldUtils method isImplicitBeanDiscoveryEnabled.

public static boolean isImplicitBeanDiscoveryEnabled() {
    boolean result = false;
    // Check the "global" configuration
    ServiceLocator serviceLocator = Globals.getDefaultHabitat();
    if (serviceLocator != null) {
        Config config = serviceLocator.getService(Config.class, ServerEnvironment.DEFAULT_INSTANCE_NAME);
        if (config != null) {
            result = Boolean.valueOf(config.getExtensionByType(CDIService.class).getEnableImplicitCdi());
        }
    }
    return result;
}
Also used : ServiceLocator(org.glassfish.hk2.api.ServiceLocator) Config(com.sun.enterprise.config.serverbeans.Config)

Aggregations

Config (com.sun.enterprise.config.serverbeans.Config)152 ActionReport (org.glassfish.api.ActionReport)73 TransactionFailure (org.jvnet.hk2.config.TransactionFailure)50 PropertyVetoException (java.beans.PropertyVetoException)34 Target (org.glassfish.internal.api.Target)31 CommandTarget (org.glassfish.config.support.CommandTarget)30 Properties (java.util.Properties)28 NetworkConfig (org.glassfish.grizzly.config.dom.NetworkConfig)23 Protocol (org.glassfish.grizzly.config.dom.Protocol)20 HashMap (java.util.HashMap)17 Server (com.sun.enterprise.config.serverbeans.Server)15 NetworkListener (org.glassfish.grizzly.config.dom.NetworkListener)15 Logger (java.util.logging.Logger)14 ColumnFormatter (com.sun.enterprise.util.ColumnFormatter)13 Protocols (org.glassfish.grizzly.config.dom.Protocols)12 ArrayList (java.util.ArrayList)11 List (java.util.List)11 BlockingQueueHandler (fish.payara.nucleus.notification.BlockingQueueHandler)10 Level (java.util.logging.Level)10 LogRecord (java.util.logging.LogRecord)10