Skip to main content

in ResourceAdaptor Type descriptor

2 replies [Last post]
fantao
Offline
Joined: 2005-03-07

It seems that the value of (subelement of ) in resource-adaptor-type-jar.xml is not used in Mobicents, other than be stored in private field.

In the InstalledResourceAdaptor class, only a private "activityInterfaceNames" field is used to store the values defined in xml.

So, what is the meaning of this element? Maybe it is remained to further use?

Regards,
fantao

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ivelin
Offline
Joined: 2003-07-13

Fantao,

Read sections 7.2 and 15.1.2 of the spec.
"This element identifies the name of the Java type. The Java type must be either an interface or a class."

example:

…

javax.csapi.cc.jcc.JccCall


...

// obtain the SBB component environment naming context.
Context initCtx = new InitialContext();
Context myEnv = (Context)initCtx.lookup("java:comp/env");
…
// get first JCC resource adaptor object
JccProvider jcc1 = (JccProvider) myEnv.lookup("slee/resources/jcc/1.0b/jcc_1");
…
// get second JCC resource adaptor object
JccProvider jcc2 = (JccProvider) myEnv.lookup("slee/resources/jcc/1.0b/jcc_2");
…
// create a call on jcc1
JccCall call = jcc1.createCall();
…
// get ActivityContectInterfaceFactory object for JCC
JccActivityContextInterfaceFactory jccACIFactory =
(JccActivityContextInterfaceFactory)
myEnv.lookup("slee/resources/jcc/1.1/activitycontextinterfacefactory");
…
// get generic Activity Context Interface object for call
ActivityContextInterface ac = jccACIFactory.getActivityContext(call);

// obtain the SBB component environment naming context.
Context initCtx = new InitialContext();
Context myEnv = (Context)initCtx.lookup("java:comp/env");
…
// get first JCC resource adaptor object
JccProvider jcc1 = (JccProvider) myEnv.lookup("slee/resources/jcc/1.0b/jcc_1");
…
// get second JCC resource adaptor object
JccProvider jcc2 = (JccProvider) myEnv.lookup("slee/resources/jcc/1.0b/jcc_2");
…
// create a call on jcc1
JccCall call = jcc1.createCall();
…
// get ActivityContectInterfaceFactory object for JCC
JccActivityContextInterfaceFactory jccACIFactory =
(JccActivityContextInterfaceFactory)
myEnv.lookup("slee/resources/jcc/1.1/activitycontextinterfacefactory");
…
// get generic Activity Context Interface object for call
ActivityContextInterface ac = jccACIFactory.getActivityContext(call);
...

If you want to dig deeper in the implementation, inspect ActivityTypeEntry and follow its uses.

fantao
Offline
Joined: 2005-03-07

Ivelin,

I've traced the value of the : the xml parser parses it into ActivityTypeEntry by setActivityTypeName method, and the getter-getActivityTypeName method is invoked only in the constructor of InstalledResourceAdaptor class, in which there is a field named activityInterfaceNames storing the value:

this.activityInterfaceNames = new String[activityEntries.length];
for(int i=0;i this.activityInterfaceNames[i] = activityEntries[i].getActivityTypeName();
}

However, there is no any getter or setter of this field, which means it is only kept there, but no longer used.