NetBeans 6 delivers great updates to the Matisse GUI builder. Spend a few minutes with Roman Strobl and get an expert briefing on what's new and what has changed. (sponsored)
In this, the third and final installation of Andres' Introduction to Groovy series, you learn about how Groovy handles variable numbers of arguments, named parameters, currying, and more about Groovy operators. Including, some new operators.
Developers of client/server applications often have to build in-house communication frameworks when business requirements can not be resolved with simple synchronous remote procedure calls. These infrastructure projects take a lot of time to develop and test and employ important resources that otherwise would be used in the main line of business.
Developing a custom communication framework might be necessary in the following situations:
The server is required to notify the client of certain events. The server notification is called a client callback and are not implemented by most RPC standards. Sometimes the standard requires the server to connect back to the client opening a new socket. This doubles the number of sockets used in communication and is not possible if the client is behind a firewall;
Connected clients may be required to create session objects on the server side and remove these objects before disconnecting. When using a framework that doesn't provide the means to cleanup session data when the client terminates the developer must refrain from creating and caching server side objects associated with the client as these can become a source of memory leaks;
The client must transfer large amounts of data to the server. The common solution is for the client to perform multiple synchronous requests transferring a chunk of data after each call. This is a serious performance problem as the client is waiting for a blank response from the server after each invocation. In this case asynchronous calls, when the client performs the invocation without waiting for a response, may speed up the transfer more than tenfold.
The Iris Application Server is addressing the above issues by implementing remote procedure call on top of a binary wire protocol that allows synchronous, asynchronous and client callbacks in a multi threaded environment over the same socket connection. When developing client/server applications using Iris the developer is implementing a set of regular Java classes that are instantiated by the server at startup. The client is using a simple API to obtain a proxy object that is implementing all the interfaces of the remote object and invokes the server by calling the interface methods.
The remainder of the article will explain how to develop an application consisting of a remote object that is invoked with a String parameter and replies with the parameter converted to uppercase. It is a very simple example but Iris development doesn't get much more difficult than this.
First the developer defines the client/server interface:
public interface IEcho
{
public String echo( String message );
}
The object deployed on the server will implement this interface:
public class EchoCommand implements IEcho
{
public String echo( String message )
{
return message.toUpperCase();
}
}
The remote objects are deployed on the server part of a remote application. The developer must provide an application descriptor file that declares the application structure to the server framework:
The server framework will create a ClassLoader for the remote application, will instantiate all remote objects declared in the descriptor file and make them available for remote invocations.
The application location must be declared to the server framework in the server file:
Iris Server 2.1 Released
URL: Accendia
At 9:26 PM on Nov 10, 2006, Catalin Merfu wrote:
Fresh Jobs for Developers Post a job opportunity
Developing a custom communication framework might be necessary in the following situations:
The Iris Application Server is addressing the above issues by implementing remote procedure call on top of a binary wire protocol that allows synchronous, asynchronous and client callbacks in a multi threaded environment over the same socket connection. When developing client/server applications using Iris the developer is implementing a set of regular Java classes that are instantiated by the server at startup. The client is using a simple API to obtain a proxy object that is implementing all the interfaces of the remote object and invokes the server by calling the interface methods.
The remainder of the article will explain how to develop an application consisting of a remote object that is invoked with a String parameter and replies with the parameter converted to uppercase. It is a very simple example but Iris development doesn't get much more difficult than this.
First the developer defines the client/server interface:
public interface IEcho { public String echo( String message ); }The object deployed on the server will implement this interface:public class EchoCommand implements IEcho { public String echo( String message ) { return message.toUpperCase(); } }The remote objects are deployed on the server part of a remote application. The developer must provide an application descriptor file that declares the application structure to the server framework: The server framework will create a ClassLoader for the remote application, will instantiate all remote objects declared in the descriptor file and make them available for remote invocations.The application location must be declared to the server framework in the server file:
The client side must connect to the server:ServerContext serverContext = new ServerContext( sever_host, port, userName, password, false );The remote objects are invoked by obtaining and casting a local proxy to the client/server interface:IEcho echo = (IEcho)serverContext.getCommandProxy( "echo_appl", "echo" ); String message = "hello iris"; String upperCase = echo.echo(message); System.out.println(upperCase);For more informations regarding the Iris Server visit http://www.accendia.com .
0 replies so far (
Post your own)