Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

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
 
Seriously Rick? Seriously? You might as well just read this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic