• 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

Narrowing Local Component

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Object obj = ctx.getEJBLocalObject();
MyComponent comp = (MyComponent)PortableRemoteObject.narrow(obj, MyComponent.class);

1. What will happen if I narrow the Local Component instead of casting it?

2. Is it allowed?

3. Are there going to be any Exceptions?

Thank you guys,

Dimiter
(SJP, SCWCD)
[ August 21, 2004: Message edited by: Dimiter Stoilov ]
 
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


1. What will happen if I narrow the Local Component instead of casting it?


It will be the same as you use casting.


2. Is it allowed?


Yes, but in fact you dont need to do so, as for local components, we already know what it is.


3. Are there going to be any Exceptions?


No if you pass in the correct Class for narrowing. Yes if you passing in the wrong Class for narrowing.

Nick
 
Dimiter Stoilov
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Nicholas
 
I guess I've been abducted by space aliens. So unprofessional. They tried to probe me with 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