Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 49.479.996 Times

Java::Import::Examples 0.03

  Date Added: November 06, 2010  |  Visits: 1.297

Java::Import::Examples

Report Broken Link
Printer Friendly Version


Product Homepage
Download (100 downloads)



Java::Import::Examples is an example of how to use Java::Import to call into Java classes. Making RMI calls from Perl One nice thing about Java is the extremely straight forward manner in which it allows you to make calls to remote objects residing on distant servers. Many people use this ability as a point of integration between their system and a posible third party or legacy system. Unfortunatly, for the most part the ability to make calls to these remote objects is something that only other Java applications can do without making a big fuss about it. However, we can now do this from Perl. Assume that I have a RMI server from which I can get data from in the form of simple Java Beans. One method of doing this is to use the GCJ::Cni library and natively compile and wrap a set of Java Classes which can then be used from my Perl script. However, there is an easier way. Lets begin by descriping the Java interfaces that well be working with. We first have the Remote Interface that we will be interacting with: import java.rmi.*; public interface RemoteInterface extends Remote { public SomeBean getMessage(String seedMessage) throws RemoteException; } And we also have the bean we will be asking for: import java.io.*; public class SomeBean implements Serializable { private String value; public SomeBean() {} public void setValue ( String _value ) { ... } public String getValue ( ) { ... } } As far as any Perl client program is concerned this is all we need to know about. Now all there is left to do is write a client: use Java::Import qw( java.rmi.Naming ); my $remote_interface = java::rmi::Naming->lookup(jstring("//localhost/Home")); my $bean = $remote_interface->getMessage(jstring("Hi there")); print $bean->getValue(), "n"; Thats all there is. Notice that all we had to tell Java::Import about was java.rmi.Naming, this is because it was the only class we used by name in our Perl code, every other Java class (the objects held by $bean and $remote_interface) was returned by some other method call originating from java.rmi.Naming. In order to run this example we have to make sure everything is in its place. We start by compiling the client code. Assuming that we have been given a Stub class file (RemoteObject_Stub.class) we can do the following: gcj -C SomeBean.java RemoteInterface.java fastjar -cvf client.jar SomeBean.class RemoteInterface.class RemoteObject_Stub.class Making sure our server is reachable we can then run the client code: CLASSPATH=client.jar perl client.pl Thats it, you should then see the message returned by your server..

Requirements: No special requirements
Platforms: Linux
Keyword: Example How To Java Javaimportexamples Libraries Perl Programming Public Remote Somebean String
Users rating: 0/10

License: Freeware Size: 28.67 KB
USER REVIEWS
More Reviews or Write Review


JAVA::IMPORT::EXAMPLES RELATED
Home & Leisure  -  How To Make A Candy Bouquet 1.0
eBook showing how to make a candy bouquet, with pictures and detailed instructions.
768 KB  
Teaching Tools  -  How to draw a horse 5
How to draw a horse drawing game. A drawing activity for kids centered around their horse. In this section you will be learning how to draw a horse. You will draw the basic shapes to help you draw the horse. how to draw a face drawing game. free /...
10.24 KB  
Networking Tools  -  How To SEO Your Website 1.0
How To SEO Your Website in the Search Engine. Steps you can take to get Ranked. The best way to set up a website to get good internet search engine placement. Get more website traffic by making your site more attractive to Google and other search...
37 KB  
E-Mail Tools  -  How to Open OST File Free 1.0
Do not worry if you are looking for a reliable solution about how to open ost file, you have already found the response. The service of Microsoft Outlook recovery, provided by How to Open OST File Free, represents the fastest way out if you...
1.86 MB  
Utilities  -  How to change folder icon 1.4
How to change folder icon? Use this handy shell extension that enables you to quickly change folder icons to indicate a priority level or project status, or you can use it to mark a folder with a special icon or color of your choice. Right-click...
985 KB  
Programming  -  Java version of Lua programming language 0.01
This project is the port of Lua programming language to Java platform. It contains the bytecode compiler and interpreter, that use the same bytecode format as the original version, and partially support standard Lua library.
88.91 KB  
Business  -  How to Generate Cash from Simply Writing Online! 9.0
Wouldn t you like to generate lots of cash writing from the comfort of your own home? In this hot report, you ll learn the following: font color="Blue"If you aren t using this software, it could be costing you both time and money. Professional...
2.07 MB  
Screen Savers  -  how to get rich screensaver 1.0
This screensaver contains important information that can help you to be successful and rich.how to get rich screensaver is tested on different operating systems without problems.Its free and nicely designed.
1.13 MB  
Education  -  How to Make Money with Adware 1.1
This tutorial will show webmasters and software developers how to make money online. After years of trying to make money on the Internet I finally discovered what works. I currently receive residual income with minimal effort. This tutorial...
363 KB  
Education  -  How to draw a pig 1
How to draw a pig drawing game. A drawing activity for kids centered around their pig. In this section you will be learning how to draw a pig. You will draw the basic shapes to help you draw the pig.
10 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB