use of alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx in project ACS by ACS-Community.
the class AcsContainer method set_logLevels.
/**
* Sets log levels for a particular named logger. If levels.useDefault is
* true, then the logger will be reset to using default levels; otherwise it
* will use the supplied local and remote levels.
*/
public void set_logLevels(String logger_name, LogLevels levels) throws LoggerDoesNotExistEx, IllegalLogLevelsEx {
tryToWaitForContainerStart();
if (levels.useDefault) {
logConfig.clearNamedLoggerConfig(logger_name);
} else {
try {
UnnamedLogger config = AcsLogLevelDefinition.createXsdLogLevelsFromIdl(levels);
logConfig.setNamedLoggerConfig(logger_name, config);
} catch (AcsJIllegalArgumentEx ex) {
//throw ex.toIllegalArgumentEx();
IllegalLogLevelsEx ille = new IllegalLogLevelsEx(ex.getErrorDesc());
throw ille;
}
}
}
use of alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx in project ACS by ACS-Community.
the class LaserComponent method set_default_logLevels.
/**
* Sets the log levels of the default logging configuration. These levels
* are used by all loggers that have not been configured individually.
*/
public void set_default_logLevels(LogLevels levels) throws IllegalLogLevelsEx {
try {
logConfig.setDefaultMinLogLevel(AcsLogLevelDefinition.fromInteger(levels.minLogLevel));
logConfig.setDefaultMinLogLevelLocal(AcsLogLevelDefinition.fromInteger(levels.minLogLevelLocal));
} catch (AcsJIllegalArgumentEx ex) {
//throw ex.toIllegalArgumentEx();
IllegalLogLevelsEx ille = new IllegalLogLevelsEx(ex.getErrorDesc());
throw ille;
}
}
use of alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx in project ACS by ACS-Community.
the class HibernateWDALImpl method set_default_logLevels.
/**
* Sets the log levels of the default logging configuration. These levels
* are used by all loggers that have not been configured individually.
*/
public void set_default_logLevels(LogLevels levels) throws IllegalLogLevelsEx {
try {
logConfig.setDefaultMinLogLevel(AcsLogLevelDefinition.fromInteger(levels.minLogLevel));
logConfig.setDefaultMinLogLevelLocal(AcsLogLevelDefinition.fromInteger(levels.minLogLevelLocal));
} catch (AcsJIllegalArgumentEx ex) {
//throw ex.toIllegalArgumentEx();
IllegalLogLevelsEx ille = new IllegalLogLevelsEx(ex.getErrorDesc());
throw ille;
}
}
use of alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx in project ACS by ACS-Community.
the class AcsContainer method ping.
/**
* Replies with <code>true</code> so that Manager sees that this container is alive.
* <p>
* Prints a message to System.out, so that it's visible on the local console that the container is doing ok. Does
* not log anything, because a failure to reply would show up remotely anyway.
* <p>
* No message is printed if the container log level is above INFO, see http://jira.alma.cl/browse/COMP-1736.
*
* @see si.ijs.maci.ClientOperations#ping()
*/
public boolean ping() {
// we cannot use m_logger.isLoggable because only the stdout log level should be considered,
// and it would be even worse a hack to go from the logger to its stdout handler to ask for the level there.
AcsLogLevelDefinition stdoutLevel;
try {
stdoutLevel = AcsLogLevelDefinition.fromXsdLogLevel(logConfig.getNamedLoggerConfig(m_containerName).getMinLogLevelLocal());
} catch (AcsJIllegalArgumentEx ex) {
stdoutLevel = AcsLogLevelDefinition.DEBUG;
ex.printStackTrace();
}
if (stdoutLevel.compareTo(AcsLogLevelDefinition.DEBUG) <= 0) {
Runtime rt = Runtime.getRuntime();
long totalMemKB = rt.totalMemory() / 1024;
long usedMemKB = totalMemKB - rt.freeMemory() / 1024;
String memStatus = "Memory usage " + usedMemKB + " of " + totalMemKB + " kB ";
long maxMem = rt.maxMemory();
if (maxMem < Long.MAX_VALUE) {
long maxMemKB = maxMem / 1024;
memStatus += "(= " + (usedMemKB * 1000 / maxMemKB) / 10.0 + "% of JVM growth limit " + maxMemKB + " kB) ";
}
String timestamp = IsoDateFormat.formatCurrentDate();
System.out.println(timestamp + " [" + m_containerName + "] ping received, container alive. " + memStatus);
}
return true;
}
use of alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx in project ACS by ACS-Community.
the class NCSubscriber method createConnectionAction.
protected void createConnectionAction(EventDispatcher evtDispatcher, ErrorReporter errRep, SCInstance scInstance, Collection<TriggerEvent> derivedEvents) throws AcsJStateMachineActionEx {
super.createConnectionAction(evtDispatcher, errRep, scInstance, derivedEvents);
try {
// Register callback for subscribed events
if (corbaRef == null) {
corbaObj = new OSPushConsumerPOATie(NCSubscriber.this);
corbaRef = OSPushConsumerHelper.narrow(helper.getContainerServices().activateOffShoot(corbaObj));
}
// Register callback for reconnection requests
channelReconnectionCallback = new AcsNcReconnectionCallback(NCSubscriber.this, logger);
// if the factory is null, the reconnection callback is not registered
channelReconnectionCallback.registerForReconnect(services, helper.getNotifyFactory());
proxySupplier.connect_structured_push_consumer(org.omg.CosNotifyComm.StructuredPushConsumerHelper.narrow(corbaRef));
} catch (AcsJContainerServicesEx e) {
LOG_NC_SubscriptionConnect_FAIL.log(logger, channelName, getNotificationFactoryName());
throw new AcsJStateMachineActionEx(e);
} catch (org.omg.CosEventChannelAdmin.AlreadyConnected e) {
throw new AcsJStateMachineActionEx(new AcsJIllegalStateEventEx(e));
} catch (org.omg.CosEventChannelAdmin.TypeError ex) {
LOG_NC_SubscriptionConnect_FAIL.log(logger, channelName, getNotificationFactoryName());
throw new AcsJStateMachineActionEx(ex);
} catch (AcsJIllegalArgumentEx ex) {
throw new AcsJStateMachineActionEx(ex);
}
// Create the thread responsible for checking the connection and reconnect
createConCheckerThread();
LOG_NC_SubscriptionConnect_OK.log(logger, channelName, getNotificationFactoryName());
}
Aggregations