Search in sources :

Example 1 with MessageParser

use of org.jdiameter.client.impl.parser.MessageParser in project jain-slee.diameter by RestComm.

the class DiameterBaseResourceAdaptor method initStack.

// Private Methods -----------------------------------------------------
/**
 * Initializes the RA Diameter Stack.
 *
 * @throws Exception
 */
private synchronized void initStack() throws Exception {
    // Register in the Mux as app listener.
    List<ApplicationId> allAppIds = new ArrayList<ApplicationId>();
    allAppIds.addAll(authApplicationIds);
    allAppIds.addAll(acctApplicationIds);
    this.diameterMux.registerListener(this, allAppIds.toArray(new ApplicationId[allAppIds.size()]));
    // Get the stack (should not mess with)
    this.stack = this.diameterMux.getStack();
    this.messageTimeout = stack.getMetaData().getConfiguration().getLongValue(MessageTimeOut.ordinal(), (Long) MessageTimeOut.defValue());
    // Obtain parser and store it in AvpUtilities
    MessageParser parser = ((IContainer) stack).getAssemblerFacility().getComponentInstance(MessageParser.class);
    AvpUtilities.setParser(parser);
    AvpUtilities.setDictionary(stack.getDictionary());
    if (tracer.isInfoEnabled()) {
        tracer.info("Diameter Base RA :: Successfully initialized stack.");
    }
}
Also used : MessageParser(org.jdiameter.client.impl.parser.MessageParser) ArrayList(java.util.ArrayList) ApplicationId(org.jdiameter.api.ApplicationId)

Aggregations

ArrayList (java.util.ArrayList)1 ApplicationId (org.jdiameter.api.ApplicationId)1 MessageParser (org.jdiameter.client.impl.parser.MessageParser)1