|
|
||
Neto Marin's BlogJuly 2007 ArchivesGetting started with JME - Part III / IIIPosted by netomarin on July 24, 2007 at 10:06 AM | Permalink | Comments (1)Hi all ... I´m back !!! ;-) Let´s finish this post series with the last (but not less important) element that´s I think is essential on a quality JME application development: Connectivity ! To be or not to be CONNECTED ?!?! Because today, be connected is more than a simple feature of a mobile application, it´s a requirement! Since from a simple search until the data synchronization with some service available at the big Net. And why not integration with other systems using SOA and webservices ? Presenting, GCF ! When I used the connectivity recourse by the first time, I didn´t believe that´s how should be too easy! I just called the same method for any kind of connection, and so start using some specific protocol like HTTP. How can GCF do this ??? First, let´s analyze the follow image to understand GCF structure:
How we can observe, all and ever kind of connection extends Connection, and so it´s easier to Java manipulate the connection. And, if we think about the net structure, we really realize that´s all connections has the same basic operation mode. The Connector class By the static calling of the method open() from Connector class, a new connection is opened. The calling is ever the same, and something like this: ...
try {
Connector.open("protocol:address;parameters");
} catch (ConnectionNotFoundExeption e) {
// no handler available for socket connections
}
...
And, if the desired protocol it´s already known, it´s just do the cast to your connection type and so use as you want. You can find practical examples of the usage at API: Low-level Networking Programming But, if you´ve created your own application protocol or have to do some special data manipulation you can use advanced stuffs like SocketConnection, ServerSocketConnection or UDPDatagramConnection, and so do as you want to. What about Bluetooth ?!?! The Bluetooth usage is increasing day-by-day, including by the mobile phones manufacturer that´s making it available in a large number of models. And, what´s already means a high-level mobile phone status, now is a important "accessory" and have been used in a different kind of applications, like: As a remote control, to replace wires, multi-player games and little (or provisional) WLANs. But, if we think about the net aspect, we are (yet) inside the GCF. But, why make it complex if we can simplify ? ;-) On this way, the Marge Project comes to help (and a lot) the usage of this (important) technology. It´s a framework to make easy all Bluetooth programming process: since the device and service discovery until the data exchange properly. JME surfing on SOA and Webservice wave! The availablement of services at Internet using the Webservice paradigm and the increased usage of this to system´s integration with SOA, brings to JME the necessity to talk with this technologies. But... What is SOA and Webservice ?
How to consume Webservices and SOA integration As the name tells, Webservice is a service available at the Web. So, we could think in use directly a HTTP Connection to access the information, correct?
Finalizing With this post, it´s the end of "Getting Started with JME" trilogy (with a little late) and now I´m feel that I can go ahead with many subjects that were introduced here and because some feedbacks that´s I´ve received by e-mail. And, to the end of this week you can wait for a complete post about the usage of Webservices and SOA integration, including some examples and tips that will be present at my session at JustJava 2007 (October, São Paulo-Brazil) !! Thanks all, Neto Marin | ||
|
|