• 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:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

arguments in Remote Home interface methods

 
Bartender
Posts: 3665
38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to define primitive arguments in
remote home interface methods ?
For example : EJB 2.0 specification, page 112

I'm quite unsure that there is error in specification. But I have read that
all arguments and returning types have to be serializable to be transferred over network (RMI calls). And primitives obviously can not implement serialazable
Maybe I have some mess in my head, sorry for confusing.
Thanks a lot.
 
Ranch Hand
Posts: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes primitives are allowed in remote home interfaces and they can be transported across the network.
 
Pradeep bhatt
Ranch Hand
Posts: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
System.out.println(int.class instanceof java.io.Serializable);
prints true
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it is the same to the valid instance varibles of STATEFUL session beans. They can be primitive types although the specification does not explicitly define it in "7.4.1 Instance passivation and conversational state"
Regards,
 
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
System.out.println(int.class instanceof java.io.Serializable);
prints true ?
Does this stmt print true for all java classes and primitive types suffixed with .class?
 
Pradeep bhatt
Ranch Hand
Posts: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of I want to say that my 2nd post has got nothing to do proving that primitives are serializable.
System.out.println(int.class instanceof java.io.Serializable);
return true because Class implements Serializable.
http://java.sun.com/j2se/1.4.1/docs/api/java/lang/Class.html
So the statement is true for all objcets class and also primitives.
Regarding the original question - All primitives are serializable.
 
Don't sweat petty things, or pet sweaty things. But cuddle this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic