|By Sirl Davis||
|January 30, 2004 07:47 AM EST||
In EJB/CORBA integration, complexity can range from simple to complex and depends in part on the direction of the communication. From EJB to CORBA, communication is relatively simple because the EJB bean invokes CORBA as it does any external resource. CORBA-to-EJB communication, however, depends on the application server's support of RMI-IIOP. If the application server doesn't support RMI-IIOP, then it's best to create a wrapper or adapter class that redirects or delegates the function calls from the client via a CORBA servant, which then calls the EJB.
Part 1: EJB/CORBA Integration
Communicating from EJB to CORBA is the simplest case. The EJB will require an ORB and some means of looking up the remote CORBA object, the servant, in a directory service that could be CosNaming or JNDI over CosNaming. Note: It isn't necessary to use CORBA 2.3, which is required by RMI-IIOP (see below). Like any external resource, such as a socket or file descriptor, any ORB can be initialized and used by the EJB.
ORB initialization should be performed once using the singleton design pattern that can act as a factory for looking up remote CORBA servants. A suitable design to ensure this scenario requires the use of a stateless session bean, which is never passivated. Entity or stateful session beans may be passivated and reactivated and would require the disposal and cleanup of the ORB, which has a high performance cost as well.
Using the stateless session bean fits the EJB model best, and the ORB can be a static data member in the bean or in the above mentioned singleton support class to help ensure one instance. A deployment descriptor can also be set, for example, in WebLogic, which allows the container to create only one stateless session bean.
Currently, there's no standard mapping between EJB and CORBA for passing user identity and transaction propagation. So, if transaction and security services are required in your implementation, then the EJB bean wrapping this CORBA call should invoke the appropriate CORBA services in the desired way. In other words there's no automatic solution, and transaction and security will need to be customized for your situation.
In Listing 1 (see www.JavaDevelopers Journal.com for listings) the Call CorbaBean is a stateless session bean implementation that makes a call to an object R which initializes the ORB (if it's not initialized) and calls the CORBA servant. The idl is also shown; the servant CORBA implementation isn't included but follows standard CORBA. More important, the R class shows the encapsulation of the CORBA processes in a singleton and as a cascade pattern to ensure single initialization and a simple interface - actually too simple, as an actual implementation would more likely provide factories for different types of objects as required by the application. A client would look up the home interface, CallCorba, and create a CallCorba bean to call the remote function "call."
CORBA to EJB
Ideally, communication from EJB to CORBA should be over RMI-IIOP. However, RMI-IIOP requires a CORBA 2.3 ORB and an EJB container that supports RMI-IIOP. Because the EJB 1.1 specification only recommends RMI-IIOP but doesn't require it, many of the application servers currently available are in compliance with the EJB1.1 specification and don't fully support RMI-IIOP. In EJB 2.0, released in July 2000, RMI-IIOP is required, and interoperability will eventually be available in all the major container vendors.
Nevertheless, it's still possible to use RMI-IIOP in some application servers, although it's likely to range in complexity from easy to perhaps impossible. For example, Inprise's Application Server product allows easy interoperability with CORBA because it's built on RMI-IIOP as would be expected, as Inprise has integrated it with their Visigenic product. On the other hand, other application servers may not provide RMI-IIOP easily for EJBs and will require creating CORBA idl stubs for all the EJB objects, then successfully compiling the resulting idl with an idl compiler. Sometimes the resulting idl must be tweaked or modified. To create RMI-IIOP between a CORBA client and EJB, follow these steps:
- Use rmic, which comes with RMI-IIOP, to create idl files from your EJB Home interface.
- Use a CORBA 2.3-compliant idl compiler to generate your stubs.
- Create your EJB CORBA client.
Even if the above steps can be accomplished with your application server, there's no standard for passing user identity and the transaction propagation over RMI-IIOP to the client. EJB transaction and security services aren't accessible over RMI-IIOP; consequently, these services will lack any current RMI-IIOP solution.
So although RMI-IIOP is the preferred solution for interoperability between EJBs and CORBA and will certainly be the better solution in the future, it may be required to communicate without RMI-IIOP. One flexible solution is to provide a CORBA wrapper servant that directs CORBA calls to the EJB object. Because this solution can easily be replaced with RMI-IIOP in the future, it will provide a design that evolves.
First, check your CORBA and EJB products. If they easily support RMI-IIOP interoperability, then use that approach. If not, the example code demonstrates a wrapper that delegates CORBA calls to EJB.
In Listing 2, the call.idl is the idl for the call to the EJB. The EJBWrapper wraps the EJB and allows the CORBA client, WrapperClient, to access the EJB though the EJBWrapper. The EJBWrapper follows the standard adapter or wrapper pattern and simply delegates the calls from the client to the EJB. Note that we're actually using the same session stateless bean used in the previous example for simplicity, although one would never make a call from CORBA through EJB to CORBA; the example is heuristic.
The design issues regarding communication from CORBA to EJB concern the usage of RMI-IIOP where possible, and where not possible the usage of the adapter design pattern, which ensures that the external resource, the ORB, is carefully handled. The stateless session bean offers the best EJB for EJB-to-CORBA communication because it allows easy management of the ORB. In addition, because the future J2EE software will evolve to support CORBA-EJB interoperability more fully, any effective design must be able to easily absorb future changes.
Part II: COM/EJB Integration
Before looking at COM-EJB communication, it's worth pointing out that SOAP is a strategic direction Microsoft is taking for interoperability. Consequently, SOAP should be considered for communication between EJB and COM. However, it would be a custom solution without the support of current application servers or J2EE technology. In addition, SOAP is relatively new, and not many stable implementations exist.
For some packages using SOAP see www.alphaworks.ibm.com/tech/soap4j or http://msdn.microsoft.com/xml/default.asp. For a stable production solution, COM/EJB bridges provide the best synchronous solution and are described below, leaving SOAP for a future investigation.
- www.linar.com/: J-Integra is a bidirectional, pure Java-COM bridge.
- www.alphaworks.ibm.com: Bridge2 Java allows ActiveX objects to be used in Java.
- http://developer.java.sun.com/developer/earlyAccess/j2eecas/: Allows COM clients to access EJBs.
- WebLogic's COM Bridge in WebLogic Server: Allows bidirectional COM/ RMI interaction.
Many COM-to-Java bridges exist. Sun has an early access Client Access Services (CAS) COM Bridge available at http://developer.java.sun.com/developer/earlyAccess/j2eecas/, that will allow any COM-enabled client to access any EJB object. In addition, bridges such as J-Integra (see www.linar.com/) and WebLogic provide bidirectional communication. Below we look at WebLogic's COM bridge; it's a popular application server that simplifies the aspect of bridging between COM and EJB.
Communicating from COM to EJB usually means that Visual Basic clients are accessing EJBs. WebLogic, for example, supports the ability of Visual Basic clients or other Microsoft services to access EJBs. Because bridges support this communication rather well, it won't be addressed in any more detail, and the remaining discussion will be on communicating from EJB to COM, which is more difficult.
EJB to COM
Communication from EJB to COM is necessary if services in Microsoft are required by EJBs. WebLogic's COM solution hosts the COM object as an RMI object. As a representative example, we'll address this bridge in detail.
WebLogic Wraps COM
Note that the WebLogic Server wraps the COM object, Test.dll, and provides an RMI interface any Java client on NT can access. WebLogic provides a "com compiler," which takes a dll file and produces the Java classes, including the interface used by RMI clients. No programming is required, as the code is automatically generated. The command is
jview weblogic.comc -nothreads -register
Unfortunately, because the standard (Sun) Java Virtual Machine differs from the Microsoft Java Virtual Machine in serialization across RMI, any network connection between the two JVMs is incompatible. Sun Microsystems is suing Microsoft over this and other differences. Consequently, WebLogic certifies that COM will work only if the WebLogic server is run on the Microsoft VM, and only Java clients running under the Microsoft VM will be able to connect to the WebLogic server, so the COM bridge will work only on NT and using only the Microsoft VM. Note: Even if the Sun and Microsoft JVMs were interoperable, C++ clients still couldn't connect to WebLogic's RMI. Therefore, the second CORBA wrapper is needed to provide true interoperability (see COM/CORBA/ EJB Integration below).
Three tests of increasing complexity were performed using the above bridge. The first was a simple function that returned void. The second returned a String. The third test returned various Microsoft COM objects that dealt with the data access (DAO) directly. Both the void and String functions worked successfully, but the more complex test hung after processing one database record and suggests not making Microsoft's Data Access Layer remote. In addition, even if making these COM objects worked easily in Java, the training issue for a Java developer to learn the COM API for data access is knowledge unlikely to be found in one person. Consequently, the best design approach is to return Strings or perhaps XML, simple objects where possible, or domain business objects that encapsulate and hide Microsoft's data access classes. Other bridges may suggest other approaches.
Risks and Disadvantages
One risk to the above approach is the dependence on the COM-Java bridge that's affected by the current lawsuit. Microsoft plans to not support Java in the future and will give Rational the development of the virtual machine (see "Microsoft, Rational strengthen ties on Java development front," www.zdnet.com/ eweek/stories/general/0,11011, 1015701,00.html). Nevertheless, WebLogic's support of the bridge provides insurance from a major vendor, and there are bridges not bound to the Microsoft VM (see www.linar.com/). Another disadvantage is that some of the features of the WebLogic Server can't be used. Because the Microsoft Java Virtual Machine must be used in order to use COM, clients can't be standard Java clients, which run on standard VMs, although wrapping the EJBs as CORBA objects would allow any client to access them (see COM/ CORBA/EJB Integration below). Note: JSP technology can't be used because it requires a standard usage of the classpath, that isn't available on the Microsoft Virtual Machine.
The WebLogic wrapper provides a simple way to bridge COM and Java with little or no programming. It provides a stable application server, which provides facilities for hosting distributed objects and easing distributed development.
Detailed Implementation Steps
To provide the above solution, WebLogic must run on the Microsoft Java Virtual Machine. In addition, the Microsoft SDK for Java ( http://www.microsoft.com/java/default.htm) must be installed on the machine. After installation, setting its classpath can be tricky, so it's worth noting that this is done in the registry (HKEY_LOCAL_MACHINE\ Software\Microsoft\JavaVM\Classpath). Some files can be automatically added to the classpath and break the WebLogic compiler. To correct the problem if it occurs, simply edit the registry to remove these files from the classpath.
Configure the WebLogic environment file, setEnv.cmd, to use the Microsoft compiler, then:
- Create a new directory and copy TestServer.dll into it (e.g., C:\weblogic\ examples\com\testser)
- Recompile com object
jview weblogic.comc -nothreads -register
- Copy the created directory weblogic to C:\weblogic\myserver\serverclasses
- Add the interface, ItestInterface, to jvc /d %CLIENT_CLASSES% ServerSideTestServer.java and write some code to use this interface
- Restart Web server after adding properties:
- Run the above ServerSideTestServer under the Microsoft Virtual Machine, jvc examples.com. ServerSideTestServer
The above can provide a simple way of integrating COM. Especially by using String-level interfaces, XML can be passed as a parameter thereby significantly reducing program effort and debugging. Restrictions exist because of the need to use the Microsoft Virtual Machine, making it more difficult to use the full feature set of J2EE. Also, the possibility that SOAP may become a better interface is worth noting. Nevertheless, the need for a production quality solution currently favors a bridge.
Part III: COM/EJB/CORBA Integration
In summary, these solutions can be used together to provide a complete COM-to-EJB-to-CORBA solution useful in those situations where these three object models need to be combined in one solution. Each model provides particular benefits and may be linked to certain legacy solutions in any given environment.
Certainly, COM allows easy integration with Microsoft, EJB provides ease of development and portability, and CORBA provides integration benefits. More importantly, in any environment there may be the presence of each model, and there may be a requirement to integrate them all. So, it's worthwhile creating a framework for integrating each model because some loss of performance will be outweighed by development and maintenance benefits.
Performance is a problem with integrating COM and CORBA through EJB. However, although two servers exist between the COM object (e.g., Test.dll) and the Client objects, both components are easily produced as described below. Certainly, this trade-off favors ease of development over performance. But this solution then provides a bridge between COM and any CORBA client that's highly flexible and can evolve with future changes. Only environments with all three of these technologies will benefit from this integration, but by placing EJB as the central standard, it simplifies the other two integrations. Furthermore, when RMI-IIOP becomes a standard, the server hosting the CORBA wrapper can be removed.
CORBA to COM
To enable CORBA to COM, a CORBA client calls a wrapper or adapter to access an EJB, which then calls COM. Note that RMI-IIOP could be used between CORBA and EJBs, but a more versatile yet performative solution is to utilize the wrapper. The CORBA wrapper delegates any CORBA calls to the RMI interface hosted by WebLogic and provides a fully interoperable solution. The wrapper is essentially a client of WebLogic and looks up the RMI interface of the COM component and provides a remote interface to clients on UNIX or NT. The CORBA interface or idl can be developed manually by creating a matching CORBA interface or by using an automatic tool provided by Visigenic, which can take a Java interface and produce idl (i.e., java2idl). Once the idl is provided the delegation must be coded directly, although this programming is straightforward and could be generated automatically if such a generator were written. Note that by writing a simple code generator that automatically generates the CORBA wrapper, no code would need to be written for the bridge software, which would improve the speed of development and improve quality.
COM to CORBA
COM-to-CORBA communication can be achieved by using the soon-to-be-released CAS, COM to J2EE bridge being developed by Sun, and then having the EJBs call CORBA. Or WebLogic's bridge from COM to EJB can be used and have the EJBs call CORBA. COM to CORBA is in fact simpler than the opposite direction, as would be expected from details discussed above.
COM-to-CORBA communication is enabled by having the COM object presented as an RMI/EJB object by the WebLogic bridge, then a CORBA server is written that wraps the RMI object and provides a CORBA interface to any client. CORBA-to-COM communication is provided easily by having EJBs invoke CORBA directly and by having a bridge between EJB and COM.
The complexity of the interface can be a critical factor in the above approach because a complex interface requires larger amounts of code in the CORBA wrapper. One possibility is to pass XML back from the COM server through the CORBA wrapper, perhaps a hybrid SOAP solution. Automating the creation, the CORBA wrapper can speed development. A second solution is to build common domain business objects and pass them through to WebLogic and Java.
The selection of a particular bridge will be dependent on platforms and overall configuration. If WebLogic's bridge is used, then the Microsoft VM will be required, as it runs only on Windows NT. Other bridges will have different requirements. However, an EJB container does simplify many of the interoperability issues by providing one standard to map both CORBA and COM rather than mapping each standard to the other, which would create six mappings: CORBA to COM, CORBA to J2EE, and so on.
EJB, CORBA, and COM are different technologies and are likely to persist in production environments. Maintaining interoperability is essential for environments that have these technologies. A number of issues have been discussed that show many of the choices required for integrating these technologies. Various trade-offs and advantages exist for different approaches and tools, and any particular environment or configuration of software will favor a different combination of these solutions.
We are reaching the end of the beginning with WebRTC, and real systems using this technology have begun to appear. One challenge that faces every WebRTC deployment (in some form or another) is identity management. For example, if you have an existing service – possibly built on a variety of different PaaS/SaaS offerings – and you want to add real-time communications you are faced with a challenge relating to user management, authentication, authorization, and validation. Service providers will want to use their existing identities, but these will have credentials already that are (hopefully) i...
Nov. 26, 2014 10:45 AM EST Reads: 560
One of the biggest challenges when developing connected devices is identifying user value and delivering it through successful user experiences. In his session at Internet of @ThingsExpo, Mike Kuniavsky, Principal Scientist, Innovation Services at PARC, described an IoT-specific approach to user experience design that combines approaches from interaction design, industrial design and service design to create experiences that go beyond simple connected gadgets to create lasting, multi-device experiences grounded in people's real needs and desires.
Nov. 26, 2014 10:45 AM EST Reads: 595
"Matrix is an ambitious open standard and implementation that's set up to break down the fragmentation problems that exist in IP messaging and VoIP communication," explained John Woolf, Technical Evangelist at Matrix, in this SYS-CON.tv interview at @ThingsExpo, held Nov 4–6, 2014, at the Santa Clara Convention Center in Santa Clara, CA.
Nov. 26, 2014 10:45 AM EST
The Internet of Things will put IT to its ultimate test by creating infinite new opportunities to digitize products and services, generate and analyze new data to improve customer satisfaction, and discover new ways to gain a competitive advantage across nearly every industry. In order to help corporate business units to capitalize on the rapidly evolving IoT opportunities, IT must stand up to a new set of challenges. In his session at @ThingsExpo, Jeff Kaplan, Managing Director of THINKstrategies, will examine why IT must finally fulfill its role in support of its SBUs or face a new round of...
Nov. 26, 2014 10:45 AM EST Reads: 379
Cultural, regulatory, environmental, political and economic (CREPE) conditions over the past decade are creating cross-industry solution spaces that require processes and technologies from both the Internet of Things (IoT), and Data Management and Analytics (DMA). These solution spaces are evolving into Sensor Analytics Ecosystems (SAE) that represent significant new opportunities for organizations of all types. Public Utilities throughout the world, providing electricity, natural gas and water, are pursuing SmartGrid initiatives that represent one of the more mature examples of SAE. We have s...
Nov. 26, 2014 10:45 AM EST Reads: 132
The Internet of Things will greatly expand the opportunities for data collection and new business models driven off of that data. In her session at @ThingsExpo, Esmeralda Swartz, CMO of MetraTech, discussed how for this to be effective you not only need to have infrastructure and operational models capable of utilizing this new phenomenon, but increasingly service providers will need to convince a skeptical public to participate. Get ready to show them the money!
Nov. 26, 2014 10:30 AM EST Reads: 575
Scott Jenson leads a project called The Physical Web within the Chrome team at Google. Project members are working to take the scalability and openness of the web and use it to talk to the exponentially exploding range of smart devices. Nearly every company today working on the IoT comes up with the same basic solution: use my server and you'll be fine. But if we really believe there will be trillions of these devices, that just can't scale. We need a system that is open a scalable and by using the URL as a basic building block, we open this up and get the same resilience that the web enjoys.
Nov. 25, 2014 09:30 PM EST Reads: 1,112
The Internet of Things is tied together with a thin strand that is known as time. Coincidentally, at the core of nearly all data analytics is a timestamp. When working with time series data there are a few core principles that everyone should consider, especially across datasets where time is the common boundary. In his session at Internet of @ThingsExpo, Jim Scott, Director of Enterprise Strategy & Architecture at MapR Technologies, discussed single-value, geo-spatial, and log time series data. By focusing on enterprise applications and the data center, he will use OpenTSDB as an example t...
Nov. 25, 2014 09:30 PM EST Reads: 1,148
P2P RTC will impact the landscape of communications, shifting from traditional telephony style communications models to OTT (Over-The-Top) cloud assisted & PaaS (Platform as a Service) communication services. The P2P shift will impact many areas of our lives, from mobile communication, human interactive web services, RTC and telephony infrastructure, user federation, security and privacy implications, business costs, and scalability. In his session at @ThingsExpo, Robin Raymond, Chief Architect at Hookflash, will walk through the shifting landscape of traditional telephone and voice services ...
Nov. 25, 2014 08:00 PM EST Reads: 1,369
The Domain Name Service (DNS) is one of the most important components in networking infrastructure, enabling users and services to access applications by translating URLs (names) into IP addresses (numbers). Because every icon and URL and all embedded content on a website requires a DNS lookup loading complex sites necessitates hundreds of DNS queries. In addition, as more internet-enabled ‘Things' get connected, people will rely on DNS to name and find their fridges, toasters and toilets. According to a recent IDG Research Services Survey this rate of traffic will only grow. What's driving t...
Nov. 25, 2014 07:00 PM EST Reads: 1,221
Enthusiasm for the Internet of Things has reached an all-time high. In 2013 alone, venture capitalists spent more than $1 billion dollars investing in the IoT space. With "smart" appliances and devices, IoT covers wearable smart devices, cloud services to hardware companies. Nest, a Google company, detects temperatures inside homes and automatically adjusts it by tracking its user's habit. These technologies are quickly developing and with it come challenges such as bridging infrastructure gaps, abiding by privacy concerns and making the concept a reality. These challenges can't be addressed w...
Nov. 25, 2014 04:30 PM EST Reads: 1,254
Explosive growth in connected devices. Enormous amounts of data for collection and analysis. Critical use of data for split-second decision making and actionable information. All three are factors in making the Internet of Things a reality. Yet, any one factor would have an IT organization pondering its infrastructure strategy. How should your organization enhance its IT framework to enable an Internet of Things implementation? In his session at Internet of @ThingsExpo, James Kirkland, Chief Architect for the Internet of Things and Intelligent Systems at Red Hat, described how to revolutioniz...
Nov. 24, 2014 07:00 PM EST Reads: 1,591
Bit6 today issued a challenge to the technology community implementing Web Real Time Communication (WebRTC). To leap beyond WebRTC’s significant limitations and fully leverage its underlying value to accelerate innovation, application developers need to consider the entire communications ecosystem.
Nov. 24, 2014 12:00 PM EST Reads: 1,470
The definition of IoT is not new, in fact it’s been around for over a decade. What has changed is the public's awareness that the technology we use on a daily basis has caught up on the vision of an always on, always connected world. If you look into the details of what comprises the IoT, you’ll see that it includes everything from cloud computing, Big Data analytics, “Things,” Web communication, applications, network, storage, etc. It is essentially including everything connected online from hardware to software, or as we like to say, it’s an Internet of many different things. The difference ...
Nov. 24, 2014 11:00 AM EST Reads: 1,608
Cloud Expo 2014 TV commercials will feature @ThingsExpo, which was launched in June, 2014 at New York City's Javits Center as the largest 'Internet of Things' event in the world.
Nov. 24, 2014 09:00 AM EST Reads: 1,618
SYS-CON Events announced today that Windstream, a leading provider of advanced network and cloud communications, has been named “Silver Sponsor” of SYS-CON's 16th International Cloud Expo®, which will take place on June 9–11, 2015, at the Javits Center in New York, NY. Windstream (Nasdaq: WIN), a FORTUNE 500 and S&P 500 company, is a leading provider of advanced network communications, including cloud computing and managed services, to businesses nationwide. The company also offers broadband, phone and digital TV services to consumers primarily in rural areas.
Nov. 23, 2014 07:30 PM EST Reads: 1,806
"There is a natural synchronization between the business models, the IoT is there to support ,” explained Brendan O'Brien, Co-founder and Chief Architect of Aria Systems, in this SYS-CON.tv interview at the 15th International Cloud Expo®, held Nov 4–6, 2014, at the Santa Clara Convention Center in Santa Clara, CA.
Nov. 23, 2014 12:00 PM EST Reads: 1,744
The major cloud platforms defy a simple, side-by-side analysis. Each of the major IaaS public-cloud platforms offers their own unique strengths and functionality. Options for on-site private cloud are diverse as well, and must be designed and deployed while taking existing legacy architecture and infrastructure into account. Then the reality is that most enterprises are embarking on a hybrid cloud strategy and programs. In this Power Panel at 15th Cloud Expo (http://www.CloudComputingExpo.com), moderated by Ashar Baig, Research Director, Cloud, at Gigaom Research, Nate Gordon, Director of T...
Nov. 23, 2014 07:45 AM EST Reads: 1,763
ARMONK, N.Y., Nov. 20, 2014 /PRNewswire/ -- IBM (NYSE: IBM) today announced that it is bringing a greater level of control, security and flexibility to cloud-based application development and delivery with a single-tenant version of Bluemix, IBM's platform-as-a-service. The new platform enables developers to build ap...
Nov. 22, 2014 05:30 PM EST Reads: 1,563
An entirely new security model is needed for the Internet of Things, or is it? Can we save some old and tested controls for this new and different environment? In his session at @ThingsExpo, New York's at the Javits Center, Davi Ottenheimer, EMC Senior Director of Trust, reviewed hands-on lessons with IoT devices and reveal a new risk balance you might not expect. Davi Ottenheimer, EMC Senior Director of Trust, has more than nineteen years' experience managing global security operations and assessments, including a decade of leading incident response and digital forensics. He is co-author of t...
Nov. 22, 2014 05:30 PM EST Reads: 1,509