public abstract class BaseProxy extends Object implements Serializable
| Modifier and Type | Class and Description |
|---|---|
class |
BaseProxy.MainThread
The main processing thread of this object.
|
class |
BaseProxy.Panel
A standard base class for graphical proxy objects.
|
| Modifier and Type | Field and Description |
|---|---|
String |
bundle
The path/filename of the resource bundle in the proxy's codebase jar
file.
|
Container |
container
A reference to the proxy's graphical user interface, if any.
|
protected RemoteInvoke |
item
The reference to the sending server, on which the proxy may
asynchronously callback.
|
protected Remote |
remoteThis
A remote reference to the proxy itself, which it can send to its server,
or other remote VMs on which they can asynchronously callback.
|
protected BaseProxy.MainThread |
runnable
A reference to the proxy's processing code.
|
String[] |
strings
The collection of strings to be displayed at the host VM.
|
Thread |
thread
The processing thread of the proxy object, it will be started
automatically upon arrival at the client when the init method is invoked.
|
| Constructor and Description |
|---|
BaseProxy()
Nothing is performed in the constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
contact(String url)
This method is canonically called when an proxy announces its reference
via the
Multicast class. |
String |
getDescription()
This method is invoked by remote users of this object.
|
Remote |
getItem(String url)
A method will load either an object, or a zipped marshalled object
(zedmob) of an object, from a URL, file, or from a remote rmiregistry.
|
Container |
init(Remote remoteRef)
This function is called by the hosting client on upon the proxy's
arrival.
|
void |
setItem(RemoteInvoke item)
This function is called by the
ItemServer during its
bind operation. |
protected transient Remote remoteThis
protected RemoteInvoke item
ItemServer
during the bind operation.protected BaseProxy.MainThread runnable
public transient Thread thread
public Container container
public String bundle
public String[] strings
public BaseProxy()
public void setItem(RemoteInvoke item)
ItemServer during its
bind operation.item - A remote reference to the server object, on which the proxy
may asynchronously call back to it.public Container init(Remote remoteRef)
remoteThis member, and can be provided to other
remote objects, on which they can contact the proxy.
If the proxy has a string bundle, the localized strings most
closely matching the locale of the receiving host will be loaded. If the
proxy is graphical in nature, i.e. provides a graphical user interface,
this method will return it to the host, so that it may display it, if it
wishes.remoteRef - A reference to the proxy, remoted in the context of the
client's VM.public Remote getItem(String url) throws RemoteException, NotBoundException, IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, MalformedURLException
Loading an object from a file can be specified in one of three ways:
url - The URL where to get the object: file://, http://, ftp://,
/path/name, path/name, or //[host][:port]/[name]. The host, port,
and name, are all optional. If missing the host is presumed local, the
port 1099, and the name "main". The referenced resource can be
returned as a MarshalledObject, it will be extracted automatically.
If the URL is null, it will be assumed to be ///.RemoteException - if the remote registry could not be reached,
or the remote instance could not be be created.NotBoundException - if the requested name is not in the registry.IOException - if the zedmob format is invalid.ClassNotFoundException - if a proxy was sent to the VM, and
proxy hosting was not enabled.InstantiationException - when the URL specifies a class name
which cannot be instantiated at runtime.IllegalAccessException - when the url specifies a class name
and it does not support a no-arg constructor.MalformedURLException - if the URL is not in the format explainedpublic String getDescription()
public void contact(String url)
Multicast class. It is expected to receive
the URLs of objects that heard the announcement, and wish to be contacted.url - A //host:port/name type URL on which the 'first-contact' object
of a remote VM can be reached.Copyright © 2016. All Rights Reserved.