use of org.mobicents.slee.resource.diameter.rx.handlers.RxSessionFactory in project jain-slee.diameter by RestComm.
the class DiameterRxResourceAdaptor method raActive.
/**
* {@inheritDoc}
*/
@Override
public void raActive() {
if (tracer.isFineEnabled()) {
tracer.fine("Diameter Rx RA :: raActive.");
}
try {
if (tracer.isInfoEnabled()) {
tracer.info("Activating Diameter Rx RA Entity");
}
this.diameterMultiplexerObjectName = new ObjectName("diameter.mobicents:service=DiameterStackMultiplexer");
Object object = null;
if (ManagementFactory.getPlatformMBeanServer().isRegistered(this.diameterMultiplexerObjectName)) {
// trying to get via MBeanServer
object = ManagementFactory.getPlatformMBeanServer().invoke(this.diameterMultiplexerObjectName, "getMultiplexerMBean", new Object[] {}, new String[] {});
if (tracer.isInfoEnabled()) {
tracer.info("Trying to get via Platform MBeanServer: " + this.diameterMultiplexerObjectName + ", object: " + object);
}
} else {
// trying to get via locateJBoss
object = MBeanServerLocator.locateJBoss().invoke(this.diameterMultiplexerObjectName, "getMultiplexerMBean", new Object[] {}, new String[] {});
if (tracer.isInfoEnabled()) {
tracer.info("Trying to get via JBoss MBeanServer: " + this.diameterMultiplexerObjectName + ", object: " + object);
}
}
if (object != null && object instanceof DiameterStackMultiplexerMBean) {
this.diameterMux = (DiameterStackMultiplexerMBean) object;
}
// Initialize the protocol stack
initStack();
// Initialize activities mgmt
initActivitiesMgmt();
// Initialize factories
this.baseAvpFactory = new DiameterAvpFactoryImpl();
this.baseMessageFactory = new DiameterMessageFactoryImpl(stack);
this.rxAvpFactory = new RxAvpFactoryImpl(baseAvpFactory);
this.rxMessageFactory = new RxMessageFactoryImpl(baseMessageFactory, null, stack);
// Set the first configured Application-Id as default for message factory
ApplicationId firstAppId = authApplicationIds.get(0);
((RxMessageFactoryImpl) this.rxMessageFactory).setApplicationId(firstAppId.getVendorId(), firstAppId.getAuthAppId());
this.sessionFactory = this.stack.getSessionFactory();
this.rxSessionFactory = new RxSessionFactory(this, sessionFactory);
// Register Rx App Session Factories
((ISessionFactory) sessionFactory).registerAppFacory(ServerRxSession.class, this.rxSessionFactory);
((ISessionFactory) sessionFactory).registerAppFacory(ClientRxSession.class, this.rxSessionFactory);
} catch (Exception e) {
tracer.severe("Error Activating Diameter Rx RA Entity", e);
}
}
Aggregations