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);
}
}
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();
}
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);
}
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());
}
}
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);
}
Aggregations