Search in sources :

Example 6 with SbbContext

use of javax.slee.SbbContext in project charging-server by RestComm.

the class HTTPClientSbb method setSbbContext.

/*
	 * (non-Javadoc)
	 * 
	 * @see javax.slee.Sbb#setSbbContext(javax.slee.SbbContext)
	 */
public void setSbbContext(SbbContext context) {
    this.sbbContext = (SbbContextExt) context;
    this.tracer = sbbContext.getTracer("CS-RF-HTTP");
    try {
        Context ctx = (Context) new InitialContext().lookup("java:comp/env");
        httpClientAci = (HttpClientActivityContextInterfaceFactory) ctx.lookup("slee/resources/http-client/acifactory");
        raSbbInterface = (HttpClientResourceAdaptorSbbInterface) ctx.lookup("slee/resources/http-client/sbbinterface");
        httpURLString = (String) ctx.lookup("HTTPURL");
    } catch (NamingException ne) {
        tracer.severe("Could not set SBB context:", ne);
    }
}
Also used : Context(javax.naming.Context) InitialContext(javax.naming.InitialContext) SbbContext(javax.slee.SbbContext) NamingException(javax.naming.NamingException) InitialContext(javax.naming.InitialContext)

Example 7 with SbbContext

use of javax.slee.SbbContext in project jain-slee.diameter by RestComm.

the class HSSClientChildSbb method setSbbContext.

/*
   * (non-Javadoc)
   * @see javax.slee.Sbb#setSbbContext(javax.slee.SbbContext)
   */
@Override
public void setSbbContext(SbbContext sbbContext) {
    this.sbbContext = (SbbContextExt) sbbContext;
    if (tracer == null) {
        tracer = sbbContext.getTracer(HSSClientChildSbb.class.getSimpleName());
    }
    try {
        Context context = (Context) new InitialContext().lookup("java:comp/env");
        diameterShClientSbbInterface = (ShClientProvider) context.lookup("slee/resources/diameter-sh-client-ra-interface");
        diameterShClientACIF = (ShClientActivityContextInterfaceFactory) context.lookup("slee/resources/JDiameterShClientResourceAdaptor/java.net/0.8.1/acif");
        diameterShClientMessageFactory = diameterShClientSbbInterface.getClientMessageFactory();
        diameterShClientAvpFactory = diameterShClientSbbInterface.getClientAvpFactory();
    } catch (NamingException e) {
        tracer.severe("Can't set sbb context.", e);
    }
}
Also used : Context(javax.naming.Context) InitialContext(javax.naming.InitialContext) SbbContext(javax.slee.SbbContext) RolledBackContext(javax.slee.RolledBackContext) NamingException(javax.naming.NamingException) InitialContext(javax.naming.InitialContext)

Example 8 with SbbContext

use of javax.slee.SbbContext in project smscgateway by RestComm.

the class TxSmppServerSbb method setSbbContext.

// *********
// SBB staff
@Override
public void setSbbContext(SbbContext sbbContext) {
    super.setSbbContext(sbbContext);
    try {
        Context ctx = (Context) new InitialContext().lookup("java:comp/env");
        this.smppServerTransactionACIFactory = (SmppTransactionACIFactory) ctx.lookup("slee/resources/smppp/server/1.0/acifactory");
        this.smppServerSessions = (SmppSessions) ctx.lookup("slee/resources/smpp/server/1.0/provider");
    } catch (Exception ne) {
        logger.severe("Could not set SBB context:", ne);
    }
}
Also used : InitialContext(javax.naming.InitialContext) EventContext(javax.slee.EventContext) SbbContext(javax.slee.SbbContext) Context(javax.naming.Context) InitialContext(javax.naming.InitialContext) ParseException(java.text.ParseException) TlvConvertException(com.cloudhopper.smpp.tlv.TlvConvertException) RecoverablePduException(com.cloudhopper.smpp.type.RecoverablePduException) CharacterCodingException(java.nio.charset.CharacterCodingException) SmppInvalidArgumentException(com.cloudhopper.smpp.type.SmppInvalidArgumentException) PersistenceException(org.mobicents.smsc.cassandra.PersistenceException)

Example 9 with SbbContext

use of javax.slee.SbbContext in project smscgateway by RestComm.

the class HomeRoutingCommonSbb method setSbbContext.

@Override
public void setSbbContext(SbbContext sbbContext) {
    this.sbbContext = (SbbContextExt) sbbContext;
    try {
        Context ctx = (Context) new InitialContext().lookup("java:comp/env");
        this.mapAcif = (MAPContextInterfaceFactory) ctx.lookup("slee/resources/map/2.0/acifactory");
        this.mapProvider = (MAPProvider) ctx.lookup("slee/resources/map/2.0/provider");
        this.mapParameterFactory = this.mapProvider.getMAPParameterFactory();
        this.mapErrorMessageFactory = this.mapProvider.getMAPErrorMessageFactory();
        this.sccpParameterFact = new ParameterFactoryImpl();
        // this.smppServerSessions = (SmppSessions) ctx
        // .lookup("slee/resources/smpp/server/1.0/provider");
        this.persistence = (PersistenceRAInterface) this.sbbContext.getResourceAdaptorInterface(PERSISTENCE_ID, PERSISTENCE_LINK);
        this.logger = this.sbbContext.getTracer(this.className);
        itsMProcRa = (MProcRuleRaProvider) this.sbbContext.getResourceAdaptorInterface(MPROC_RATYPE_ID, MPROC_RA_LINK);
    } catch (Exception ne) {
        logger.severe("Could not set SBB context:", ne);
    }
// TODO : Handle proper error
}
Also used : Context(javax.naming.Context) InitialContext(javax.naming.InitialContext) SbbContext(javax.slee.SbbContext) RolledBackContext(javax.slee.RolledBackContext) ParameterFactoryImpl(org.restcomm.protocols.ss7.sccp.impl.parameter.ParameterFactoryImpl) InitialContext(javax.naming.InitialContext) CreateException(javax.slee.CreateException)

Example 10 with SbbContext

use of javax.slee.SbbContext in project smscgateway by RestComm.

the class AlertSbb method setSbbContext.

@Override
public void setSbbContext(SbbContext sbbContext) {
    this.sbbContext = (SbbContextExt) sbbContext;
    try {
        Context ctx = (Context) new InitialContext().lookup("java:comp/env");
        this.mapAcif = (MAPContextInterfaceFactory) ctx.lookup("slee/resources/map/2.0/acifactory");
        this.mapProvider = (MAPProvider) ctx.lookup("slee/resources/map/2.0/provider");
        this.mapParameterFactory = this.mapProvider.getMAPParameterFactory();
        this.logger = this.sbbContext.getTracer(AlertSbb.class.getSimpleName());
        this.persistence = (PersistenceRAInterface) this.sbbContext.getResourceAdaptorInterface(PERSISTENCE_ID, PERSISTENCE_LINK);
        this.scheduler = (SchedulerRaSbbInterface) this.sbbContext.getResourceAdaptorInterface(SCHEDULER_ID, SCHEDULER_LINK);
    } catch (Exception ne) {
        logger.severe("Could not set SBB context:", ne);
    }
}
Also used : InitialContext(javax.naming.InitialContext) EventContext(javax.slee.EventContext) SbbContext(javax.slee.SbbContext) Context(javax.naming.Context) RolledBackContext(javax.slee.RolledBackContext) MAPApplicationContext(org.restcomm.protocols.ss7.map.api.MAPApplicationContext) InitialContext(javax.naming.InitialContext) CreateException(javax.slee.CreateException) PersistenceException(org.mobicents.smsc.cassandra.PersistenceException) MAPException(org.restcomm.protocols.ss7.map.api.MAPException)

Aggregations

Context (javax.naming.Context)10 InitialContext (javax.naming.InitialContext)10 SbbContext (javax.slee.SbbContext)10 EventContext (javax.slee.EventContext)5 RolledBackContext (javax.slee.RolledBackContext)5 CreateException (javax.slee.CreateException)4 PersistenceException (org.mobicents.smsc.cassandra.PersistenceException)3 MAPApplicationContext (org.restcomm.protocols.ss7.map.api.MAPApplicationContext)3 MAPException (org.restcomm.protocols.ss7.map.api.MAPException)3 ParameterFactoryImpl (org.restcomm.protocols.ss7.sccp.impl.parameter.ParameterFactoryImpl)3 RecoverablePduException (com.cloudhopper.smpp.type.RecoverablePduException)2 CharacterCodingException (java.nio.charset.CharacterCodingException)2 NamingException (javax.naming.NamingException)2 SmscProcessingException (org.mobicents.smsc.library.SmscProcessingException)2 TlvConvertException (com.cloudhopper.smpp.tlv.TlvConvertException)1 SmppInvalidArgumentException (com.cloudhopper.smpp.type.SmppInvalidArgumentException)1 ParseException (java.text.ParseException)1 MAPProvider (org.restcomm.protocols.ss7.map.api.MAPProvider)1