Remote calls to JVx without UI

Contains useful source code for specific use cases.

Remote calls to JVx without UI

Postby Development@SIB » Thu Jan 05, 2012 2:50 pm

JVx is a full stack application framework, but all parts are independent. It is no problem to use only the communication classes or the Swing controls without GenUI. This snippet shows how it is possible to use JVx only on server side. You have full session handling and the client is built with your preferred UI or you client has no UI.

Use JVx on server-side as usual. Integrate it into an application server like Tomcat or use it standalone.

Use the communcation classes to access server objects and actions. A simple object call could be implemented like the following snippet.

Gets the source code for a specific class via Server Object:

Code: Select all
HttpConnection httpcon = new HttpConnection("http://demo.sibvisions.org/showcase/services/Server");

MasterConnection macon = new MasterConnection(httpcon);
macon.setApplicationName("showcase");
macon.setUserName("admin");
macon.setPassword("admin");
macon.open();

macon.call("sourceCode", "get", "com.sibvisions.apps.showcase.frames.ChartFrame");


Gets data from the database:

Code: Select all
SubConnection subcon = macon.createSubConnection("com.sibvisions.apps.showcase.frames.Contacts");
subcon.open();

RemoteDataSource dataSource = new RemoteDataSource();
dataSource.setConnection(subcon);
dataSource.open();
      
RemoteDataBook rdbContacts = new RemoteDataBook();
rdbContacts.setDataSource(dataSource);
rdbContacts.setName("contacts");
rdbContacts.open();

rdbContacts.fetchAll();

Use rdbContacts to insert/update/delete records.
User avatar
Development@SIB
 
Posts: 311
Joined: Mon Sep 28, 2009 1:54 pm

Return to Code snippets