Category: java

Dec 01 2010

JavaSpaces – An introductory example.

Hello,

This example, is a microblog service, “similar” to twitter. It uses JavaSpaces

JavaSpaces – example

Best Regards,
Matheus

Oct 07 2010

WebServices – An introductory example.

Hello,

This example shows on Client to a Web Service. One Web Service that is a Client too (Collector) and just a Web Service (Store)

The program used to create it was Netbeans with Glassfish. The version of Netbeans was netbeans-6.9.1-ml-java.

Client, Collector, Stores – Example of WebServices

Espero que o exemplo seja útil a você.
Matheus

Sep 21 2010

An example of use of CORBA

Hello

CORBA (Common Object Request Broker Architecture) is a standart defined by OMG (Object Management Group), this let distributed object from different languages and OS to communicate. It also provides total transparency in the communication. The IDL (Interface Definition Language) is the tecnology used to describe the interfaces. IDL has your own data types, that are mapped to the data types in other languages. There is an IDL compiler, it generates the codes that do the communication.

But how it works? We have some definitions in a .idl file, in this case Bank-idl (remember to change the filename).

Read more »

Sep 02 2010

Java RMI – Intro and Example

Good Night,

Java RMI (Remote Method Invocation), is a mechanism that let the user, create distributed applications using Java. It takes care of Sockets, protocols and others. But how it works? All the magic is done by RMI. It have a server named RMIREGISTRY, where your server connect and says “I’m here”. After this Clients can connect to RMIREGISTRY and find the server that it wants.

I will show you an example of a Car Advertisement server, where Clients can add and search for Vehicle.

Read more »

Sep 17 2009

Send files using XML-RPC in Java

Hello

Tooday Jorge send me an e-mail asking how to send files using XML-RPC. So I did some modifications in Client and Server, Java XML-RPC to do this.

I implemented this and it wasn’t so hard. I read the documentation of Apache XML-RPC to see how to send bytes. They are send using an array of bytes (byte[]) in a Base64 codification.

To create the Base64 codification I used Java Base64 in public domain.

How to get an array of bytes from a file

How to create a file from a array of bytes

XML-RPC-Transfer-file

Matheus

PS: This is just an example, any file that client ask, the server will send. It WILL BE A SYSTEM VULNERABILITY!

Jun 23 2009

MD5 “Decrypter”, Java

Hello

What is MD5 Decrypter? It is a distributed system to break MD5 hash using bruteforce.

Implementation of MD5 Decrypter

There is a lot of thins that can be update:
- Number of Slaves variable.
- Work in the WORDS class distribution

Best Regards,
Matheus

Jun 22 2009

Parking Lot Exercise, Java, Concurrent Programming

Hello,

This is a problem of Concurrent Programming that I solved in a test:

The parking lot have 30 spots. Since the parking lot have spots, it doesn’t have priority. When it is full, starts to make a line. Professors have the highest priority, Employees have the Medium priority, and then it comes the students. Use Java to simulate 10 Professors, 15 employees, 30 students.

Concurrent Programming, Parking lot – JAVA

Matheus

May 16 2009

Client and Server, Java XML-RPC

Good night,

A few days ago I created a XML-RPC server to test some functions. What is XML-RPC? XML-RPC is a remote procedure call (RPC) protocol which uses XML to encode its calls and HTTP as a transport mechanism.(wikipedia) To start using XML-RPC in Java I used apache xml-rpc.

Example client and server XML-RPC.

Best Regards,
Matheus