Solved

How to make a java program acceseble from other programs

Posted on 2002-03-04
6
184 Views
Last Modified: 2010-03-31
In C++ it is possible to make at .DLL file and register it as at service. When registered the service runs at OS startup, and one can connect to it and call the public methods in the program from  e.g ASP source code.

I would like to do the same thing with at Java program, and connect to its public methods from both ASP and JSP source code. The program contains a datastructure and the public methods put(key, value) and get(key). I use multithreading and need to keep the datastructure in the RAM, not on the hard disk.

How do I make such a program available to other webprograms(what environmental wrapping should it have)?

0
Comment
Question by:Bjarke
6 Comments
 
LVL 3

Expert Comment

by:saxaboo
ID: 6839357
Hi,

is it some kind of registry you want to implement ?

In a 100% Java world, I would think about a RMI implementation (RMI = Remote Method Invocation = RPC mechanism for Java)

Now you apparently need VBScript (ASP) clients, and before even starting to begin to pre-think about writing a RMI client in VBScript I would preferrably think about other options ...

=> aren't web services a solution in that case ? Implement your "get/put" service as a web service (you can use Apache software foundation tools for this part)
Then call your web service from your JSP or ASP pages, in both cases you have freely available and easy-to-use APIs to do so (M$ SOAP Toolkit, for example, makes it easy to write VBScript web services consumers)

This is a path you could follow, among many others that our EE fellows will for sure mention.

Hope this high-level view helps,

-S
0
 
LVL 3

Expert Comment

by:saxaboo
ID: 6839370
Hi,

is it some kind of registry you want to implement ?

In a 100% Java world, I would think about a RMI implementation (RMI = Remote Method Invocation = RPC mechanism for Java)

Now you apparently need VBScript (ASP) clients, and before even starting to begin to pre-think about writing a RMI client in VBScript I would preferrably think about other options ...

=> aren't web services a solution in that case ? Implement your "get/put" service as a web service (you can use Apache software foundation tools for this part)
Then call your web service from your JSP or ASP pages, in both cases you have freely available and easy-to-use APIs to do so (M$ SOAP Toolkit, for example, makes it easy to write VBScript web services consumers)

This is a path you could follow, among many others that our EE fellows will for sure mention.

Hope this high-level view helps,

-S
0
 

Expert Comment

by:muhotrepius
ID: 6841155
When using JSP and ASP you usually have some kind of a container - jsp server or web server.
You want to use your class file on the server-side , right?
Tell us where you gona place your JSPs/ASPs ??
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Expert Comment

by:skinsella
ID: 6841266
2 Questions here

1.  How do you run a java application in the background so that it starts up when the machine starts and isn't interrupted when a user logs in/out?

Answer: There are lots of programs that allow java programs to be installed as Windows Services.  My favourite is JavaService, a free product.  The URL and documentation is at the below address.  It's really not very hard to install services just be careful about the user that the service runs as and the permissions that that user has on the computer.

http://www.alexandriasc.com/software/JavaService/index.html

2. How can you write a java program that can expose it's services to ASPs and different languages running on a compuer.  The fact that the program is running as an NT service is irrelevant at this stage.  You should probably consider making the get() and put() services available over a common protocol - like HTTP.  You could use XML and do it as a web service, or use a proprietary format of your choice.  Other options might be CORBA, RMI etc. but HTTP is nicer.

-sk
0
 
LVL 35

Expert Comment

by:girionis
ID: 8658551
No comment has been added lately, so it's time to clean up this TA.

I will leave a recommendation in the Cleanup topic area that this question is:

- To be PAQ'ed and points NOT refunded

Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

girionis
Cleanup Volunteer
0
 

Accepted Solution

by:
Chmod earned 0 total points
ID: 8735779
As recommended

Chmod
Community Support Moderator @Experts Exchange
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now