Java Reference
In-Depth Information
Listing 9-9. Accessing a Remote Object
import java.rmi.*;
import javax.microedition.xlet.*;
import javax.microedition.xlet.ixc.*;
public class XletLocationConsumer implements Xlet {
private XletContext context;
private Location location;
private static final String NAME =
"XletLocationProducer.location";
public XletLocationConsumer () {
}
public void initXlet( XletContext c )
throws XletStateChangeException {
context = c;
try {
IxcRegistry registry = IxcRegistry.getRegistry(context);
if ( registry == null ) {
throw new XLetStateChangeException("No registry");
}
location = (Location)registry.lookup(NAME);
}
catch(NotBoundException e){
throw new XletStateChangeException("Nothing bound");
}
catch(StubException e){
throw new XletStateChangeException("Stub error");
}
}
public void pauseXlet() {
}
public void startXlet()
throws XletStateChangeException {
}
 
Search WWH ::




Custom Search