Skip to main content

EJB AND OTHER TECHNOLOGIES

17)What’s the relationship between Enterprise JavaBeans component architecture and CORBA?
The Enterprise JavaBeans specification is intended to support compliance with the range of CORBA standards, current and proposed.
A Bean’s remote and home interfaces are RMI compliant, and thus can interact with CORBA objects via RMI/IIOP, Sun and IBM’s forthcoming adaptation of RMI that conforms with the CORBA-standard IIOP protocol.
As a companion to the Enterprise JavaBeans specification, Sun Microsystems has defined a standard mapping from Enterprise Java Beans API to CORBA IDL.
JTA, the transaction API prescribed by the Enterprise JavaBeans specification for bean-managed transactions, is designed to layer easily over the OMG OTS transaction standard.
18)What’s the relationship between Enterprise JavaBeans component architecture and XML technology?
The two technologies are complementary: Enterprise JavaBeans defines a standard for portable business logic and XML technology defines a standard for portable data.
19)What’s the relationship between the Enterprise JavaBeans architecture and JTA?
The Enterprise JavaBeans architecture is intended to conceal transactional complexities from the component developer. Thus, developers and deployers writing to Enterprise JavaBeans architecture don’t need to access transaction management programmatically. However, in the case of bean- or client-managed transactions, the developer can call methods of JTA to initiate and complete transactions. JTA defines the Java programming language interfaces related to transaction management on the Java platform, conformant with the OMG/OTS standard.
The JTA UserTransaction interface is intended to be provided by containers to enable both bean-managed and client-managed transactions.
20)What’s the relationship between Enterprise JavaBeans and JDBC/SQLJ?
An entity bean can implement data persistence in one of two ways: bean-managed or container-managed. In the case of bean-managed persistence, the implementor of an entity bean stores and retrieves the information managed by the bean by means of direct database calls. For these, the bean can use either JDBC or SQLJ. The one tradeoff of this approach is that it makes it harder to adapt bean managed persistence to alternate data sources.
In the case of container-managed persistence, the container provider may implement access to the database using these APIs. The container provider can offer tools to map instance variable of an entity bean to calls to an underlying database. This approach makes it easier to use Beans with different databases.
Session beans also typically access the data they manage using JDBC or JSQL.
21)How does the Enterprise JavaBeans 2.0 Specification support messaging?
The EJB 2.0 Specification defines JMS support through a new type of enterprise bean, the message-driven bean. A message-driven bean is invoked by the EJB container as the result of the arrival of a JMS message. To a client, the message-driven bean is a JMS consumer that implements some business logic on the server. Clients communicate with message-driven beans by sending messages to a JMS Destination (either a Queue or a Topic) for which the message-driven bean is a MessageListener.
Message driven beans are distinct from both Entity and Session beans. They have neither home nor remote interfaces. Instead, they implement the javax.jms.MessageListener interface.
22)What new features are provided to support container-managed persistence for Entity beans?
The EJB 2.0 Specification defines a new mechanism for modeling persistent data with Entity beans, and a new query language for Entity beans. Features to support persistent data models include new abstract classes for both Entity beans and dependent objects. These classes can be implemented to define complex models for persistent data. EJB 2.0 also defines new deployment descriptor elements to define the^Mabstract schema supported by a bean. These allow the bean developer to specify the data model at development time, then allow a container’s deployment tools to automatically^Mgenerate the appropriate helper classes at deployment time. This provides additional platform-independence while supporting a richer representation of the data underlying an Entity bean. In addition, EJB 2.0 defines the EJB QL, a query language that enables developers^Mto traverse the data model of Entity beans independently of the language used^Mby the underlying database. ^MEJB QL uses the abstract schema of entity beans, their dependent objects, and the^Mrelationships between these objects for its data model. The syntax of EJB QL is similar to that of SQL.
EJB QL enables Bean Providers to write two types of query methods:
Finder methods in the home interface to enable entity bean clients to select specific entity objects.
Select methods which allow a bean internal access to related data without exposing^Mthat data directly to the client.
23)How does EJB 2.0 improve support for interoperability between EJB containers and other J2EE products?
The EJB 2.0 public draft specification includes requirements on EJB container/server providers which enable interoperability for invocations on enterprise beans. These requirements enable communication with J2EE clients including JavaServer Pages, Servlets, Application Clients as well as with enterprise beans in other EJB containers. The goal of these features is to allow enterprise bean invocations to work even when client components and enterprise beans are deployed in J2EE products from different vendors. Support for interoperability between components includes transaction propagation, naming services and security services.
The interoperability mechanisms in EJB 2.0 are based on the IIOP protocol from the Object Management Group. The extensions supporting distributed transaction propagation, security (using SSL) and naming service access are all based on OMG standards. J2EE container products may also use vendor-specific protocols in addition to IIOP.
7
Is is possible for an EJB client to marshall an object of class java.lang.Class to an EJB?
Technically yes, spec. compliant NO! - refer to section 18.1.2 of the EJB 1.1 specification (page 273). "The enterprise bean must not attempt to query a class to ...
Is it possible to write two EJB’s that share the same Remote and Home interfaces, and have different bean classes?
if so, what are the advantages/disadvantages?
Sharing interfaces might be possible, but not trivial.
If you deploy with Sun Deployment Tool 1.2.1 you will get a
java.lang.ClassCastException: MyBean2EJB_EJBObjectImpl ...

Is it possible to specify multiple JNDI names when deploying an EJB?
No. To achieve this you have to deploy your EJB multiple times each
specifying a different JNDI name. Java:API:EJB Andrea Pompili ...
What is the status of the UML-EJB Mapping Specification (JSR 26)?
Thank you for your interest in JSR-000026. It is currently > in the expert group stage, meaning that the CAll For > Experts (CAFE) was issued and replies were received. ...
Is it legal to have static initializer blocks in EJB?
Although technically it is legal, static initializer blocks are used to execute some piece of code before executing any constructor or method while instantiating ...
In CMP how can I define a finder method equivalent
to a ‘SELECT * FROM TABLE’? [RC - Please give reference
to the particular AppServer you are using]
Weblogic 5.1.0 - Define the following Finder syntax in your weblogic-ejb-jar.xml deployment descriptor. All ...
Is it possible to access a CORBA object from a EJB? I am using VisiBroker 4.0 for my CORBA objects and J2EE 1.2.1 for my EJB.
These properties can be set on the commandline (using -Dorg. or using a file named orb.properties. Java:API:EJB, Java:API:CORBA Robert Castaneda ...
How can we interact with COM/DCOM components from a EJB component ?
A list of tools that integrate Java with the Microsoft platform is available here. These tools can be used, as long as they stay within the EJB specification requirements ...

Is it possible to stop the execution of a method before completion in a SessionBean?
Threads inside an EJB, refer to section 18.1.2 of the EJB 1.1 specification. One possible solution (that requires coding) would be to set the transaction that the ...
Is it legal to have static initializer blocks in EJB?
Is it legal to have static initializer blocks in EJB? Java:API:EJB ravi srivatsav ...

Comments

Popular posts from this blog

Advantages & Disadvantages of Synchronous / Asynchronous Communications?

  Asynchronous Communication Advantages: Requests need not be targeted to specific server. Service need not be available when request is made. No blocking, so resources could be freed.  Could use connectionless protocol Disadvantages: Response times are unpredictable. Error handling usually more complex.  Usually requires connection-oriented protocol.  Harder to design apps Synchronous Communication Advantages: Easy to program Outcome is known immediately  Error recovery easier (usually)  Better real-time response (usually) Disadvantages: Service must be up and ready. Requestor blocks, held resources are “tied up”.  Usually requires connection-oriented protocol

XML Binding with JAXB 2.0 - Tutorial

Java Architecture for XML Binding (JAXB) is an API/framework that binds XML schema to Java representations. Java objects may then subsequently be used to marshal or unmarshal XML documents. Marshalling an XML document means creating an XML document from Java objects. Unmarshalling means creating creating a Java representation of an XML document (or, in effect, the reverse of marshaling). You retrieve the element and attribute values of the XML document from the Java representation. The JAXB 2.0 specification is implemented in JWSDP 2.0. JAXB 2.0 has some new features, which facilitate the marshalling and unmarshalling of an XML document. JAXB 2.0 also allows you to map a Java object to an XML document or an XML Schema. Some of the new features in JAXB 2.0 include: Smaller runtime libraries are required for JAXB 2.0, which require lesser runtime memory. Significantly, fewer Java classes are generated from a schema, compared to JAXB 1.0. For each top-level complexType, 2.0 generates a v

WebSphere MQ Interview Questions

What is MQ and what does it do? Ans. MQ stands for MESSAGE QUEUEING. WebSphere MQ allows application programs to use message queuing to participate in message-driven processing. Application programs can communicate across different platforms by using the appropriate message queuing software products. What is Message driven process? Ans . When messages arrive on a queue, they can automatically start an application using triggering. If necessary, the applications can be stopped when the message (or messages) have been processed. What are advantages of the MQ? Ans. 1. Integration. 2. Asynchrony 3. Assured Delivery 4. Scalability. How does it support the Integration? Ans. Because the MQ is independent of the Operating System you use i.e. it may be Windows, Solaris,AIX.It is independent of the protocol (i.e. TCP/IP, LU6.2, SNA, NetBIOS, UDP).It is not required that both the sender and receiver should be running on the same platform What is Asynchrony? Ans. With messag