org.iids.aos.webservices.wsgateway
Class WSGatewayPublishModule

java.lang.Object
  extended by org.iids.aos.systemservices.module.AbstractModule
      extended by org.iids.aos.webservices.wsgateway.WSGatewayPublishModule
All Implemented Interfaces:
Module

public class WSGatewayPublishModule
extends AbstractModule

Module that allows agent services to be accessible over SOAP messages. This module sits as a layer between an AgentProxy and the incoming requests over HTTP.

Author:
rjtimmer

Constructor Summary
WSGatewayPublishModule(Communicator comm, AgentHandle boot)
          Start the publish module.
 
Method Summary
 boolean isStarted()
           
 void publishService(java.lang.String name, AgentHandle handle, java.lang.String className, byte[] jar)
          Publish an agent service through the WSDL gateway.
 void start()
           
 void stop()
          TODO also temporarily stop the proxies etc?
 void unPublishService(java.lang.String serviceName)
          Deregister a service from the gateway.
 
Methods inherited from class org.iids.aos.systemservices.module.AbstractModule
getCommunicator, getModuleName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WSGatewayPublishModule

public WSGatewayPublishModule(Communicator comm,
                              AgentHandle boot)
Start the publish module.

Parameters:
comm - A Communicator. What more can I say?
boot - A local handle used to create new handles from (for proxies)
Method Detail

start

public void start()

stop

public void stop()
TODO also temporarily stop the proxies etc?


isStarted

public boolean isStarted()

publishService

public void publishService(java.lang.String name,
                           AgentHandle handle,
                           java.lang.String className,
                           byte[] jar)
                    throws WSGatewayException
Publish an agent service through the WSDL gateway. Others can now see the service (no UDDI yet) and contact it through the web service gateway.

Incoming SOAP request are automatically routed to the agent proxy.

Parameters:
name - The name of the service to publish
handle - Handle the service uses to receive request.
className - Main-Class name of the service. The interface and WSDL documents are generated from this class.
jar - A jar file containing all the bytecode for the classes that implement the service and the parameters. This is required because these classes may be internal to the agent, and these need to be locally available otherwise the proxies will not work.
Throws:
WSGatewayException - The service cannot be published for some reason.

unPublishService

public void unPublishService(java.lang.String serviceName)
                      throws WSGatewayException
Deregister a service from the gateway. After this, the service cannot be accessed over SOAP request anymore.

TODO also take into account that now anyone can deregister the service. We should supply some kind of token when deregistering?

Parameters:
serviceName - The name of the service to deregister.
Throws:
WSGatewayException - If the service cannot be unpublished.


Copyright © 2003, 2004 IIDS Group. All Rights Reserved.