Real Time Information Director User Documentation
RTID Message Format and Programmatic Interfaces
Hewlett-Packard Company 14 529618 - 002
dispatch method using streams returns an integer result, which is 0 if the request was
successful, 1 if the request failed. The dispatch method using strings returns a response
document if the request was successful, an error document if the request failed.
For information about how XML document formats correlate with the document
definition metadata, see the document entitled RTID Metadata Language.
DispatchBeanHome Class
Your client uses the home interface of the DispatchEJB to create or locate the Dispatch
EJB in the EJB container. The class is called DispatchBeanHome and is defined as
follows:
package com.hp.rtid.beans;
import javax.ejb.*;
import java.rmi.RemoteException;
public interface DispatchBeanHome extends EJBHome
{
// get a Dispatch Interface
public DispatchBean create()
throws CreateException, RemoteException;
}
DispatchBean Class
Your client uses the remote home interface of the DispatchEJB to access the Dispatch
EJB remotely. The class is called DispatchBean and is defined as follows:
package com.hp.rtid.beans;
import java.io.InputStream;
import java.io.OutputStream;
import java.rmi.RemoteException;
import javax.ejb.EJBObject;
public interface DispatchBean extends EJBObject
{
public int dispatch(String document)
throws RemoteException;
public int dispatch(InputStream documentInputStream, OutputStream
documentOutputStream)
throws RemoteException;
}
Writing an EJB Client
Although the specifics of processing will vary with the client, a common outline of steps
is as follows. If your application is local to the Director:
1. Import the DispatchBeanHome and DispatchBean classes into your program.
Both classes are in the package com.hp.rtid.beans: