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

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

Serving Software Downloads in 976 Categories, Downloaded 29.645.026 Times

Java::Import::Examples 0.03

  Date Added: November 06, 2010  |  Visits: 849

Java::Import::Examples

Report Broken Link
Printer Friendly Version


Product Homepage
Download (81 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
Network Management Tools  -  How To Make A Resume 1.0
A quick and easy guide on how to make a resume. Includes tips and tricks on cover letters and job interviews too. Learn how to write a resume that will get noticed for all the right reasons. Whether you are thinking of changing jobs or have just...
1.58 MB  
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  
Information Lookup  -  How To Build Muscle 1.0
How to build muscle fast and avoid skinny guy mistakes. Free bodybuilding ebook that reveals the top 20 ways to screw up in the gym. Avoid these mistakes that almost every skinny guy makes.
2.49 MB  
Screen Savers  -  Stock Market How To 1.0
Stock Market How To - Learn more about the stock market and how to make money trading the market at homepage
5 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  
Utilities  -  JPype for Linux 0.5.4.2
JPype is an effort to allow python programs full access to java class libraries. This is achieved not through re-implementing Python, as Jython/JPython has done, but rather through interfacing at the native level in both Virtual Machines.
184.32 KB  
Programming  -  JPype 0.5.4.2
JPype is an effort to allow python programs full access to java class libraries. This is achieved not through re-implementing Python, as Jython/JPython has done, but rather through interfacing at the native level in both Virtual Machines.
180.06 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 KB  
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  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
Libraries  -  wolfSSL 3.11.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...
2.73 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