Chapter 3: EAServer Components
EAServer components contain the methods that execute business logic and access data sources. The EAServer server-side component support and client-side stub or proxy support are independent. Any EAServer client can execute any type of component. A component of any model can execute components of another model using intercomponent calls without the use of additional gateway software.
EAServer provides support for several major component models, including:
Enterprise JavaBeans EAServer supports Java components that follow the Java Software Enterprise JavaBean (EJB) specification, versions 1.0, 1.1, and 2.0. An Enterprise JavaBean is a nonvisual, transactional component that is implemented in Java. For more information, see “Enterprise JavaBeans components”, and Chapter 7, “Creating Enterprise JavaBeans Components,” in the EAServer Programmer’s Guide.
A message-driven bean (MDB) is a type of EJB specifically designed as a Java Message Service consumer. Chapter 31, “Using the Message Service,” in the EAServer Programmer’s Guide describes how to create MDBs.
CORBA-Java CORBA-Java components follow the CORBA component model and use standard CORBA interfaces for transaction management. Almost any Java class with nonvisual behavior can be adapted to run as an EAServer component. Chapter 11, “Creating CORBA Java Components,” in the EAServer Programmer’s Guide describes the EAServer Java component support in detail.
PowerBuilder NVO components Using PowerBuilder, you can create nonvisual objects (NVOs) that run natively in EAServer as EAServer components. You can also create NVO proxies for EAServer components, then use the proxies in PowerBuilder client applications. See the Application Techniques manual in the PowerBuilder documentation.
CORBA-C++ components EAServer C++ components are C++ classes that contain methods with similar prototypes to the EAServer component interface; the exact interface mapping complies with the CORBA specification for IDL/C++ language bindings.
Chapter 14, “Creating CORBA C++ Components,” in the EAServer Programmer’s Guide describes C++ component support in detail.
ActiveX You can install any nonvisual ActiveX component as an EAServer component (though you may need to define an “adaptor,” or wrapper class to handle methods that use unsupported parameter datatypes). EAServer uses the Component Object Model (COM) and ActiveX automation support to execute ActiveX component methods. Consequently, all EAServer ActiveX components must support COM’s automation interface (the IDispatch interface). Many application development tools, such as Microsoft Visual Basic, can be used to create ActiveX components that are compatible with EAServer.
Chapter 19, “Creating ActiveX Components,” in the EAServer Programmer’s Guide describes EAServer’s ActiveX support in detail.
EAServer currently implements subsets of the Microsoft Transaction Server (MTS) ActiveX interface with the goal of providing full compatibility in the future.
C components EAServer provides a C “pseudo” component model that you can use to adapt existing C procedural applications as EAServer components. C components are dynamic link libraries (DLLs) or UNIX shared libraries that contain C or C++ methods and method skeletons. Method skeletons contain C functions that retrieve the RPC’s parameters and invoke C component methods.
Appendix C, “Creating C Components,” in the EAServer Programmer’s Guide describes support for this component model.
Applications invoke an EAServer component using a stub or proxy object. The stub or proxy acts as a local surrogate for the remote component; it provides the same method signatures as the component and hides the details of remote server communication. Stubs and proxies are available for:
Java (CORBA and EJB) Any component can be invoked via a Java stub class. EAServer Manager generates source code for Java stubs. At runtime, your client program instantiates the stub. When you call methods on the stub class, the stub transparently invokes the component method on EAServer. You can also create Java servlets or JavaServer pages that run in EAServer and call components. Using this model, you can create “zero-install” applications. With EAServer built-in HTTP support, these applications have no client-machine installation requirements other than the presence of a Web browser. You can add additional interactive functionality to browser-based clients using Java applets that run in the browser.
EAServer supports three Java client models:
EJB Your program uses the EJB (javax.ejb) classes and EAServer EJB stubs to call EAServer component methods. This client model follows the EJB 2.0 Specification and is backward compatible with the EJB 1.1 and 1.0 specifications. Chapter 8, “Creating Enterprise JavaBeans Clients,” in the EAServer Programmer’s Guide describes how to implement EJB clients.
CORBA-Java Your program uses the EAServer CORBA-compliant Java ORB or any other CORBA-compliant Java ORB to instantiate stubs. Stub method signatures are mapped from the component’s interface definition, based on the CORBA specification of IDL-Java language bindings. Chapter 12, “Creating CORBA Java Clients,” in the EAServer Programmer’s Guide describes how to implement CORBA-Java clients.
PowerBuilder PowerBuilder allows you to generate NVOs that act as proxies for EAServer components. Using a proxy, you can call component methods as if they were implemented as local NVO methods. See Application Techniques in the PowerBuilder documentation.
C++ (CORBA) Your program uses the EAServer CORBA-compliant C++ ORB or any other CORBA-compliant C++ ORB to instantiate stubs. Stub method signatures are mapped from the component’s interface definition, based on the CORBA specification of IDL-C++ language bindings. Chapter 15, “Creating CORBA C++ Clients,” in the EAServer Programmer’s Guide describes how to implement C++ clients.
ActiveX Your program invokes EAServer components using the EAServer ActiveX proxy. The ActiveX proxy allows you to invoke EAServer components from ActiveX-enabled visual builder tools such as Microsoft Visual Basic. Used on the server, the ActiveX proxy allows you to invoke any EAServer component from an ActiveX component. EAServer Manager generates the type-library information that is required to register the component interface with your development tool. The ActiveX proxy uses the EAServer C++ client ORB to communicate with EAServer. Chapter 20, “Creating ActiveX Clients,” in the EAServer Programmer’s Guide describes how to use the ActiveX proxy.
Methods As Stored Procedures (MASP) EAServer provides a built-in interface that allows you to execute component methods as if they were stored procedures in an Adaptive Server Enterprise database. You can use this interface to call EAServer components from scripting and user-interface-builder tools that are database-aware but that do not support ActiveX. Appendix A, “Executing Methods As Stored Procedures,” in the EAServer Programmer’s Guide describes how to use this client interface.
CORBA is a distributed component architecture defined by the Object Management Group (OMG). EAServer supports the CORBA IIOP.
For information on the CORBA architecture, see the specifications available at the OMG Web site.
|Copyright © 2005. Sybase Inc. All rights reserved.|