
Examples
This directory contains some examples demonstrating the
features of HORB. If you want to see source files, use a text editor.
A learning course is prepared. See the HORB
flyer's guide.
These examples were written for HORB 1.2 and Java 1.0.
Examples of Client-Server Programming
- clientServer
- This is the simplest example. A client creates an object
in a remote server, then call a method of it.
- constructor
- You must call a constructor after creating a remote object
reference.
- interfaceCall
- Example of a use of an interface of server object.
interfaceCall2
Another example of use of interface and proxy.
- passObj
- Example for passing an instance of a class.
- interfaceSend
- A bit complicated example for passing object via interface.
- objRefSend
- An example of remote object reference passing.
- complex
- You can pass arbitrary structured objects to remote methods.
A loop is passed as a loop. (You can pass this.)
- reviveHook
- when an object moves, the hook methods of the object
are automatically called.
- inheritance
- Example of inheritance in remote method calls.
- inheritance2
- An example of use of inheritance in remote method call.
This examples uses an abstract class. (You can pass this.)
- inheritance3
- An example of use of inheritance in object passing. (You
can pass this.)
- inheritance4
- This is an example of inheritance in remote method call
and object passing. It demonstrates method overriding and field shadowing.
(You can pass this.)
- daemon
- Example of daemon object. This explains how to create
a non-temporary object and how to connect it from clients.
- serverServer
- Peer to peer communication. This example shows how to
start HORBServer in a standalone program.
- accessControl
- You can fully control access permissions to class, object
and method for host, network address, domain, user and password.
- config
- configuration file and acl file.
- async
- This exlains asynchronous method call, timeout, callback
object. An example of dynamic load balancing is also included.
- invitation
- Example of invitation (standalone client version). Invitation
is a mechanism that enables a server to call methods of a client. See invitation2
for an applet-server example.
- multiServer
- This example shows how to start HORBServer in your program
instead of running the horb command. One HORB process can have multiple
HORB servers for serving multiple ports simultaneously.
- persistent
- You can save an object to a file, and then load it later
when you need it.
- objectStorage
- A simple object storage class provides methods for loading
objects, saving objects, file locking and so on. It is accessible remotely.
Examples of Applet-Server Programming
- wclock
- A small applet to demonstrate use of HORB with applets.
- wordlClock
- Example of Inter-applet communication.
- invitation2
- Example of invitation (applet version). Invitation is
a mechanism that enables a server to call methods of an applet.