• Post Reply Bookmark Topic Watch Topic
  • New Topic

Local Interface & Remote Interface  RSS feed

 
Malli Raman
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Is it possible to define the local interface and remote interface in the same ejb home interface class. If so then how the deployment descriptor will be defined for the same.

For example if I am using the Customer Bean to be declared as Remote and Local then how the CustomerHome interface be declared?

public interface CustomerHome extends javax.ejb.Home, javax.ejb.LocalHome
{



}

Is there any examples available for the same.

Thanks & Regards,
M.S.Raman
 
KasiMurugan Ramasamy
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it's not possible.
 
Malli Raman
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by KasiMurugan Ramasamy:
it's not possible.


Thanks Kasi for replying the post.

In order to implement the local & Remote funcationalities assume that I have two component interfaces and two home interfaces then

Component Interfaces:

public interface CustomerLocal extends javax.ejb.ejbLocalObject
{
public void getCustomerData(int CustomerID);
}

public interface Customer extends javax.ejb.ejbObject
{
public void getCustomerData(int CustomerID) throws RemoteException;

}


Home Interfaces:

public interface CustomerLocalHome extends javax.ejb.ejbLocalHome
{
public CustomerLocal create(String customerID) throws CreateException;
}

public interface CustomerHome extends javax.ejb.ejbHome
{
public Customer create(String customerID) throws CreateException, RemoteException;

}

Now I have one Bean class CustomerBean as


public class CustomerBean implements javax.ejb.EntityBean
{
public void getCustomerData(int CustomerID)
{
System.out.println("Customer Name: " + Customer.getCustomerName());
}

}


In this whether can I call the getCustomerData(int CustomerID) method in both local & Remote Interface. Is it possible. What are the new changes coming in EJB3.0?
 
Arul Prasad
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

u have two Entity beans one is of local and other is the Remote

any way you can deploy in to two beans with diff JNDI names ....

the different is if it is Local it is available for only to its

own container whereas Remote Object is one which will available in Remote

if u are in the Remote u need to call the Businness Method through your
RemoteObject Only

if u are in the Local(Same Container) u can use the local Object itself


 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!