• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Local Interface & Remote Interface

 
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it's not possible.
 
Malli Raman
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
I’m tired of walking, and will rest for a minute and grow some wheels. This is the promise of this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic