Search in sources :

Example 1 with IiopService

use of org.glassfish.orb.admin.config.IiopService in project Payara by payara.

the class DeleteIiopListener method execute.

/**
 * Executes the command with the command parameters passed as Properties
 * where the keys are the parameter names and the values the parameter values
 *
 * @param context information
 */
@Override
public void execute(AdminCommandContext context) {
    final Target targetUtil = services.getService(Target.class);
    final Config config = targetUtil.getConfig(target);
    ActionReport report = context.getActionReport();
    IiopService iiopService = config.getExtensionByType(IiopService.class);
    if (!isIIOPListenerExists(iiopService)) {
        report.setMessage(localStrings.getLocalString("delete.iiop.listener" + ".notexists", "IIOP Listener {0} does not exist.", listener_id));
        report.setActionExitCode(ExitCode.FAILURE);
        return;
    }
    try {
        ConfigSupport.apply(new SingleConfigCode<IiopService>() {

            @Override
            public Object run(IiopService param) throws PropertyVetoException, TransactionFailure {
                List<IiopListener> listenerList = param.getIiopListener();
                for (IiopListener listener : listenerList) {
                    String currListenerId = listener.getId();
                    if (currListenerId != null && currListenerId.equals(listener_id)) {
                        listenerList.remove(listener);
                        break;
                    }
                }
                return listenerList;
            }
        }, iiopService);
        report.setActionExitCode(ExitCode.SUCCESS);
    } catch (TransactionFailure e) {
        String actual = e.getMessage();
        report.setMessage(localStrings.getLocalString("delete.iiop.listener.fail", "failed", listener_id, actual));
        report.setActionExitCode(ExitCode.FAILURE);
        report.setFailureCause(e);
    }
}
Also used : PropertyVetoException(java.beans.PropertyVetoException) TransactionFailure(org.jvnet.hk2.config.TransactionFailure) IiopListener(org.glassfish.orb.admin.config.IiopListener) Target(org.glassfish.internal.api.Target) CommandTarget(org.glassfish.config.support.CommandTarget) Config(com.sun.enterprise.config.serverbeans.Config) IiopService(org.glassfish.orb.admin.config.IiopService) List(java.util.List) ActionReport(org.glassfish.api.ActionReport)

Example 2 with IiopService

use of org.glassfish.orb.admin.config.IiopService in project Payara by payara.

the class CreateIiopListenerTest method tearDown.

@After
public void tearDown() throws TransactionFailure {
    ConfigSupport.apply(new SingleConfigCode<IiopService>() {

        public Object run(IiopService param) throws PropertyVetoException, TransactionFailure {
            List<IiopListener> listenerList = param.getIiopListener();
            for (IiopListener listener : listenerList) {
                String currListenerId = listener.getId();
                if (currListenerId != null && currListenerId.equals("iiop_1")) {
                    listenerList.remove(listener);
                    break;
                }
            }
            return listenerList;
        }
    }, iiopService);
    parameters = new ParameterMap();
}
Also used : PropertyVetoException(java.beans.PropertyVetoException) TransactionFailure(org.jvnet.hk2.config.TransactionFailure) IiopListener(org.glassfish.orb.admin.config.IiopListener) IiopService(org.glassfish.orb.admin.config.IiopService) List(java.util.List) ParameterMap(org.glassfish.api.admin.ParameterMap) After(org.junit.After)

Example 3 with IiopService

use of org.glassfish.orb.admin.config.IiopService in project Payara by payara.

the class IIOPUtils method postConstruct.

// private GlassFishORBManager gfORBMgr;
public void postConstruct() {
    processType = processEnv.getProcessType();
    if (processEnv.getProcessType().isServer()) {
        Config c = services.getService(Config.class, ServerEnvironment.DEFAULT_INSTANCE_NAME);
        iiopService = c.getExtensionByType(IiopService.class);
        final Collection<ThreadPool> threadPool = c.getThreadPools().getThreadPool();
        final Collection<NetworkListener> listeners = allByContract(NetworkListener.class);
        final Set<String> names = new TreeSet<String>();
        threadPools = new ArrayList<ThreadPool>();
        for (NetworkListener listener : listeners) {
            names.add(listener.getThreadPool());
        }
        for (ThreadPool pool : threadPool) {
            if (!names.contains(pool.getName())) {
                threadPools.add(pool);
            }
        }
        serverRefs = allByContract(ServerRef.class);
    }
    IIOPUtils.initMe(this);
}
Also used : Config(com.sun.enterprise.config.serverbeans.Config) IiopService(org.glassfish.orb.admin.config.IiopService) TreeSet(java.util.TreeSet) ThreadPool(org.glassfish.grizzly.config.dom.ThreadPool) ServerRef(com.sun.enterprise.config.serverbeans.ServerRef) NetworkListener(org.glassfish.grizzly.config.dom.NetworkListener)

Example 4 with IiopService

use of org.glassfish.orb.admin.config.IiopService in project Payara by payara.

the class CertificateManagementRestApiHandlers method getAllListenerNamesAndUrls.

/**
 * Gets the names of all HTTP and IIOP listeners for the target instance and the links to them.
 * @param contextPath The root context path
 * @param config The config of the target instance
 * @param serviceLocator The ServiceLocator to get additional HK2 services from
 * @param listeners The list of listeners to populate
 * @param usedByLinks The map of usedBy links to populate
 */
private static void getAllListenerNamesAndUrls(String contextPath, Config config, ServiceLocator serviceLocator, List<String> listeners, Map<String, String> usedByLinks) {
    List<Protocol> protocols = config.getNetworkConfig().getProtocols().getProtocol();
    String httpConfigUrl = contextPath + "/web/grizzly/networkListenerEdit.jsf?configName=" + config.getName() + "&cancelTo=web/grizzly/networkListeners.jsf";
    for (Protocol protocol : protocols) {
        listeners.add(protocol.getName());
        usedByLinks.put(protocol.getName(), httpConfigUrl + "&name=" + protocol.getName());
    }
    IiopService iiopService = serviceLocator.getService(IiopService.class);
    String iiopConfigUrl = contextPath + "/corba/sslEdit.jsf?configName=" + config.getName();
    List<IiopListener> iiopListeners = iiopService.getIiopListener();
    for (IiopListener listener : iiopListeners) {
        listeners.add(listener.getId());
        usedByLinks.put(listener.getId(), iiopConfigUrl + "&name=" + listener.getId());
    }
}
Also used : IiopListener(org.glassfish.orb.admin.config.IiopListener) IiopService(org.glassfish.orb.admin.config.IiopService) Protocol(org.glassfish.grizzly.config.dom.Protocol)

Example 5 with IiopService

use of org.glassfish.orb.admin.config.IiopService in project Payara by payara.

the class JWSAdapterManager method postConstruct.

@Override
public synchronized void postConstruct() {
    installRootURI = serverContext.getInstallRoot().toURI();
    logger = Logger.getLogger(JavaWebStartInfo.APPCLIENT_SERVER_MAIN_LOGGER, JavaWebStartInfo.APPCLIENT_SERVER_LOGMESSAGE_RESOURCE);
    iiopService = config.getExtensionByType(IiopService.class);
    umbrellaRoot = new File(installRootURI).getParentFile();
    umbrellaRootURI = umbrellaRoot.toURI();
    systemLevelSignedJARsRoot = new File(serverEnv.getInstanceRoot(), JWS_SIGNED_SYSTEM_JARS_ROOT);
    domainLevelSignedJARsRoot = new File(serverEnv.getInstanceRoot(), JWS_SIGNED_DOMAIN_JARS_ROOT);
}
Also used : IiopService(org.glassfish.orb.admin.config.IiopService) JarFile(java.util.jar.JarFile) File(java.io.File)

Aggregations

IiopService (org.glassfish.orb.admin.config.IiopService)16 IiopListener (org.glassfish.orb.admin.config.IiopListener)11 PropertyVetoException (java.beans.PropertyVetoException)6 TransactionFailure (org.jvnet.hk2.config.TransactionFailure)6 Config (com.sun.enterprise.config.serverbeans.Config)4 ParameterMap (org.glassfish.api.admin.ParameterMap)4 PropsFileActionReporter (com.sun.enterprise.admin.report.PropsFileActionReporter)3 ActionReport (org.glassfish.api.ActionReport)3 AdminCommandContextImpl (org.glassfish.api.admin.AdminCommandContextImpl)3 CommandRunner (org.glassfish.api.admin.CommandRunner)3 CommandTarget (org.glassfish.config.support.CommandTarget)3 Target (org.glassfish.internal.api.Target)3 Before (org.junit.Before)3 CreateSsl (com.sun.enterprise.admin.commands.CreateSsl)2 DeleteSsl (com.sun.enterprise.admin.commands.DeleteSsl)2 List (java.util.List)2 NetworkListener (org.glassfish.grizzly.config.dom.NetworkListener)2 Ssl (org.glassfish.grizzly.config.dom.Ssl)2 ClusterInstanceInfo (com.sun.corba.ee.spi.folb.ClusterInstanceInfo)1 SocketInfo (com.sun.corba.ee.spi.folb.SocketInfo)1