|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.gloin.example.jrap.useresourceservice.StartUserService
Start a simple service which references a resource service in its codebase annotation (i.e. the service proxy is annotated with a jrap url). Steps startup utility takes to perform this task:
org.gloin.resource.protocol.jrap.Handler.install()
.Other ways to install the handler include:
-Djava.protocol.handler.pkgs=org.gloin.resource.protocol
on the command line as described in the
java.net.URL
documentation.Note: The above install method just programmatically appends to this property.
sun.net.www.protocol.jrap.Handler
in
CLASSPATH
.
JrapURLParser
using the supplied query string
parameter
jar:user-service.jar!/export-jars/user-service-dl.jar
.The httpServer will send the proxy jar file to discovered resource services when this service registers its proxy byte codes with those services.
Please note: the http server is only one way to create an
inputstream from which the resource service can read jar file
bytes. For example, sending a simple
ByteArrayInputStream
would also have worked (though it
would have the minor drawback of not being able to do chunked data
transfer).
URLInputStream
to
ResourceRegistration.registerResource
to register the
bytes of the user service proxy jar file resource
ExportClassLoader
from a location not in
CLASSPATH
. The implementation class for this user
defined service is defined in a class loader whose export urls (see
ExportClassLoader
) are a jrap url built from the query
string parameter to this program.
Constructor Summary | |
StartUserService()
|
Method Summary | |
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StartUserService()
Method Detail |
public static void main(java.lang.String[] args) throws java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |