|
From: Leif M. <lei...@ta...> - 2008-12-29 04:32:04
|
Uri,
This is possible on Windows by making use of the
WrapperManager.sendServiceControlCode(...) method. The methods to
access services require that a SecurityManager be set in the JVM.
The documentation on this is still quite weak on the web site. I have
summarized the process below.
Setting the security manager:
1) In the Wrapper.conf file, add the following lines:
---
wrapper.java.additional.1=-Djava.security.manager
wrapper.java.additional.2=-Djava.security.policy=../conf/java.policy
---
The first tells Java to use a security manager. The second specifies
where the java policy file is located.
When you set a security manager, you are in effect overriding Java's
default security policy. Many things that normally work will start
throwing security errors unless those functions are specifically
authorized in the policy file.
2) Create the java.policy file so it contains at least the following:
---
// Give Wrapper classes full permissions
grant codeBase "file:../lib/wrapper.jar" {
permission java.security.AllPermission;
};
// Grant various permissions to a specific service.
grant codeBase "file:../lib/-" {
permission org.tanukisoftware.wrapper.security.WrapperServicePermission
"myservice", "interrogate,start,stop";
};
---
The first block lets the classes wrapper.jar do anything. This is
advised as the Wrapper needs to be able to launch your entire
application meaning that anything your application does is originating
from the Wrapper.
The second block means that any other classes in jars in your lib
directory are able to make calls to interrogate, start, and stop the
"myservice" service via the Wrapper. If this is not there then the
calls will result in SecurityExceptions being thrown.
Please let me know if you have any questions,
Cheers,
Leif
On Sun, Dec 28, 2008 at 3:51 PM, Uri Scheiner <ur...@no...> wrote:
> Hi All,
>
>
>
> I would like to use 2 different instances of wrappers in my application.
> Part of the functionality that I need, is that one wrapper will be able to
> control the other (stop, start, get its status, etc).
>
> Can anyone suggest how to do it?
>
> Thanks,
>
> Uri
--
Leif Mortenson
Representative Director
Tanuki Software, Ltd.
6-16-7-1001 Nishi-Kasai, Edogawa-ku
Tokyo 134-0088 Japan
Tel/Fax: +81-3-3878-0415
http://www.tanukisoftware.com
lei...@ta...
|