Win a copy of Pragmatic AI this week in the Artificial Intelligence forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Local and Remote annotations  RSS feed

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

Consider the declarations

@Remote
public interface I1

@Local
public interface I2

@Stateful
public class CartBean implements I1, I2

Is it possible ?
if so, what is the CartBean type local or remote ?

Thanks
Kathiresan



 
best scout
Bartender
Posts: 1294
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kathiresan,

this is absolutely legal in EJB 3. Your bean class may implement both, a remote and and a local interface just like a regular Java class can implement multiple interfaces. So it can act like I2 or/and I1 at the same time. Of course only the methods declared in I1 are available for remote calls then.

Marco


 
Kathiresan Chinna
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Marco

Kathir
 
Marco Ehrentreich
best scout
Bartender
Posts: 1294
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome

Besides as an advice from my personal experience I can only recommend you to try such examples in practice by making little example projects. Although I don't have a SCBCD certification I learned the most about EJB by experimenting to see how things work. Often you'll remember this better than by only reading books without any practical experiences. A modern IDE like NetBeans makes the deployment of enterprise applications very easy so you can concentrate only on problems in your code just like with your example.

Marco
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!