Search in sources :

Example 16 with AcsJIllegalArgumentEx

use of alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx in project ACS by ACS-Community.

the class DALImpl 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 {
    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;
        }
    }
}
Also used : IllegalLogLevelsEx(alma.Logging.IllegalLogLevelsEx) UnnamedLogger(alma.maci.loggingconfig.UnnamedLogger) AcsJIllegalArgumentEx(alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx)

Example 17 with AcsJIllegalArgumentEx

use of alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx in project ACS by ACS-Community.

the class AcsNcReconnectionCallback method registerForReconnect.

/**
	 * Called by the event subscriber or supplier when connecting to the NC.
	 * Corba-activates this callback object using <code>services</code> and
	 * registers it with the NotifyService's {@link ReconnectionRegistry}.
	 * <p>
	 * @throws AcsJContainerServicesEx 
	 * @throws AcsJIllegalArgumentEx 
	 * @TODO: This call does not do anything if the <code>ecf == null</code>,
	 * which is also mentioned in comments in the calling code. 
	 * This should be cleaned up, e.g. checked if at all and under which circumstances
	 * this null can happen. 
	 */
public void registerForReconnect(ContainerServicesBase services, EventChannelFactory ecf) throws AcsJContainerServicesEx, AcsJIllegalArgumentEx {
    // TODO: This is strange...
    if (ecf == null) {
        return;
    }
    if (services == null) {
        AcsJIllegalArgumentEx ex = new AcsJIllegalArgumentEx();
        ex.setVariable("services");
        ex.setValue("null");
        throw ex;
    }
    this.services = services;
    ReconnectionRegistry registry = null;
    try {
        registry = ReconnectionRegistryHelper.narrow(ecf);
    } catch (BAD_PARAM ex) {
        // TODO: Or should we just return, same deal as above with ecf == null?
        AcsJIllegalArgumentEx ex2 = new AcsJIllegalArgumentEx(ex);
        ex2.setErrorDesc("The given EventChannelFactory is not a NotifyExt.ReconnectionRegistry. Make sure TAO extensions are used!");
        throw ex2;
    }
    ecf_ = ecf;
    ReconnectionCallback callback = ReconnectionCallbackHelper.narrow(services.activateOffShoot(this));
    callback_id_ = registry.register_callback(callback);
    id_is_valid_ = true;
}
Also used : ReconnectionCallback(NotifyExt.ReconnectionCallback) BAD_PARAM(org.omg.CORBA.BAD_PARAM) AcsJIllegalArgumentEx(alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx) ReconnectionRegistry(NotifyExt.ReconnectionRegistry)

Example 18 with AcsJIllegalArgumentEx

use of alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx in project ACS by ACS-Community.

the class Helper method splitChannelAndDomainName.

private static String[] splitChannelAndDomainName(String channelWithDomainName) throws AcsJIllegalArgumentEx {
    String[] ret = channelWithDomainName.split(NAMESERVICE_BINDING_NC_DOMAIN_SEPARATOR.value);
    if (ret.length == 2) {
        return ret;
    } else {
        AcsJIllegalArgumentEx ex = new AcsJIllegalArgumentEx();
        ex.setVariable("channelWithDomainName");
        ex.setValue(channelWithDomainName);
        ex.setErrorDesc("No unique NC - domain separation found in NC binding.");
        throw ex;
    }
}
Also used : AcsJIllegalArgumentEx(alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx)

Example 19 with AcsJIllegalArgumentEx

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;
    }
}
Also used : IllegalLogLevelsEx(alma.Logging.IllegalLogLevelsEx) AcsJIllegalArgumentEx(alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx)

Example 20 with AcsJIllegalArgumentEx

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;
    }
}
Also used : IllegalLogLevelsEx(alma.Logging.IllegalLogLevelsEx) AcsJIllegalArgumentEx(alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx)

Aggregations

AcsJIllegalArgumentEx (alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx)21 IllegalLogLevelsEx (alma.Logging.IllegalLogLevelsEx)12 UnnamedLogger (alma.maci.loggingconfig.UnnamedLogger)6 AcsJContainerServicesEx (alma.JavaContainerError.wrappers.AcsJContainerServicesEx)3 AcsJException (alma.acs.exceptions.AcsJException)2 LogConfig (alma.acs.logging.config.LogConfig)2 ReconnectionCallback (NotifyExt.ReconnectionCallback)1 ReconnectionRegistry (NotifyExt.ReconnectionRegistry)1 AcsJCORBAProblemEx (alma.ACSErrTypeCommon.wrappers.AcsJCORBAProblemEx)1 AcsJGenericErrorEx (alma.ACSErrTypeCommon.wrappers.AcsJGenericErrorEx)1 AcsJIllegalStateEventEx (alma.ACSErrTypeCommon.wrappers.AcsJIllegalStateEventEx)1 AcsJStateMachineActionEx (alma.ACSErrTypeCommon.wrappers.AcsJStateMachineActionEx)1 LogLevels (alma.Logging.LoggingConfigurablePackage.LogLevels)1 ComponentLifecycleException (alma.acs.component.ComponentLifecycleException)1 AcsLogLevel (alma.acs.logging.AcsLogLevel)1 LockableUnnamedLogger (alma.acs.logging.config.LogConfig.LockableUnnamedLogger)1 AcsLogLevelDefinition (alma.acs.logging.level.AcsLogLevelDefinition)1 OSPushConsumerPOATie (alma.acsnc.OSPushConsumerPOATie)1 LogTypeHelper (com.cosylab.logging.engine.log.LogTypeHelper)1 Date (java.util.Date)1