Application wide variables with Tomcat/Axis

P

pitthekid

Hello,

I have installed axis on Tomcat and a few WebServices.

My Problem: I want to have a >>APPLICATION WIDE OBJECT<<, which you can
reach from a WebService as well as a Java Application which is running
on this server.

I would like to have something similar to the Session Object on a Web
Page where you can add and remove items.



Scenario:
-------------
The Programm Codes who share a Class called MyQueue, which is a Class
which holdes
all the processes.


WebService1(Pseudo Code)/**Fills Queque with new Datasets*/
public boolean fillQueue(int GUID, String ProcId){
MyQueue myqueue = getLivingQueue(); //This function shell give
me the actual queque,

//NOT a new one!!
MyQueueDataset oneDataSet= myqueue.create() ;//Create a new
DataSet

//in the Queue.
oneDataSet.setProcId(ProcId);
oneDataSet.setGUID(GUID);
oneDataSet.setStatus("InQueue");
...
return true;
}

WebService2:(Pseudo Code)/*Find out Status of certain Queque*/
public String getStatusOfGUID(int GUID){
MyQueue myqueue = getLivingQueue(); //This function shell give
me the actual queque,

//NOT a new one!!
MyQueueDataset oneDataSet = myqueue.getByGUID(GUID);
return oneDataSet .status;
}

A Job:(Pseudo Code)/*Try to proceed DataSets which havent proceede
yet*/
Class Watcher(){
int static main(){
....
MyQueue myqueue = getLivingQueue();
while(1==1){
ArrayList allJobsNotDone =
myqueue.getAllDataSetsWhichAreNotSuccessFullProceedd()
while(allJobsNotDone.hasNext() ){
MyQueueDataset notJetSuccesfullProceedeJob =
allJobsNotDone.next();
//Now we call a function which lets say try to put the values

//of notJetSuccesfullProceedeJob into a database.
proceed(notJetSuccesfullProceedeJob );

}
}
}
}

Is this possible just with Tomcat?
Do I need a Messaging System (JMS) or something?

I would appreciate help very much.

Thanks in advanced,
Peter
 
M

Matt Humphrey

pitthekid said:
Hello,

I have installed axis on Tomcat and a few WebServices.

My Problem: I want to have a >>APPLICATION WIDE OBJECT<<, which you can
reach from a WebService as well as a Java Application which is running
on this server.

I would like to have something similar to the Session Object on a Web
Page where you can add and remove items.

I'm not entirely sure what you mean, but presuming that your web service
executes in a separate JVM (e.g. Tomcat) from your Java application you will
not be able to have a directly shared object. You can, however, host the
object on a web service and have your standalone application access it via a
request or you can setup the object as an RMI service which is accessed from
both the application and the web service.

Matt Humphrey (e-mail address removed) http://www.iviz.com/
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

pitthekid said:
I have installed axis on Tomcat and a few WebServices.

My Problem: I want to have a >>APPLICATION WIDE OBJECT<<, which you can
reach from a WebService as well as a Java Application which is running
on this server.

I would like to have something similar to the Session Object on a Web
Page where you can add and remove items.

If the app is a GUI app or console app, then it should call
the web service too.

If it is a web app, then if the web app and the web service
is bundled and loaded with the same classloader, then they
can share objects (like a singleton).

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top