cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
74
Views
0
Helpful
0
Comments
cdnadmin
Level 11
Level 11
This document was generated from CDN thread

Created by: Zahid Mahmood on 14-03-2011 08:41:17 AM
hi,
 
i have developed a java class, that has been place in start up and
set a java object in application data, like this
 
public class Startup implements StartApplicationInterface {
    public void
onStartApplication(ApplicationStartAPI arg0) throws AudiumException {
           RandomAccessFile
writer;
          writer = new
RandomAccessFile(fileName,"rw");
        
 arg0.setApplicationData("writer", writer);
    }
}
 
now i get writer object in other java class, that class  is being used in vxml project, like this.
 
import com.audium.server.session.ActionElementData;
import com.audium.server.voiceElement.*;
 
public class PrintDetail implements ElementInterface{
 
 RandomAccessFile writer;
 
       public void doAction
(String s, ActionElementData actionelementdata)  throws
ElementException{
 
              writer
= ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿..;
 
        }
}
where is dots that is point where i want to get application data
(RandomAccessFile object)
kindly help me.
 
Thanks and regards,

Subject: RE: accessing application data in java class
Replied by: Althaf Bealdar on 10-05-2011 04:57:33 AM
HI Zahid,

You can type cast the  object to RandomAccessFile.

for your above code you can use the below snippet

writer =(RandomAccessFile) actionelementdata.getApplicationAPI().getApplicationData("writer");

With this you can retrieve object from application level.


Regards,
Althaf
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links