Win a copy of TDD for a Shopping Website LiveProject this week in the Testing 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

JAX -RPC

 
Ranch Hand
Posts: 8944
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was just reading web services tutorial from Sun where I noticed the following
A service endpoint interface must conform to a few rules:
� It extends the java.rmi.Remote interface.
� It must not have constant declarations, such as public final static.
Why the above restrictions?

Thanks
 
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Pradeep Bhat:
I was just reading web services tutorial from Sun where I noticed the following
A service endpoint interface must conform to a few rules:
• It extends the java.rmi.Remote interface.
• It must not have constant declarations, such as public final static.
Why the above restrictions?

Thanks


Pradeep,
I just started looking at this forum...
My understanding of these points is as follows. First, you are not actually forced to use the rmi.Remote, but you must implement it.
Second, the static final really only applies to objects (not primitives). The reason is that the interface is stateless, so there would be no assurance that your created objects will be what you expect in subsequent invokations.
I hope this helps (my experience with web services with java comes from one of my recent courses in a Masters program, by the way.
 
Pradeep bhatt
Ranch Hand
Posts: 8944
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

First, you are not actually forced to use the rmi.Remote, but you must implement it.


To create an webserice in JAX-RPC we need to create an interface that extends java.rmi.Remote, implement that interface. Remote interface is just a signal(empty) interface .

.

the static final really only applies to objects (not primitives).


I dont agree

The reason is that the interface is stateless, so there would be no assurance that your created objects will be what you expect in subsequent invokations.


can you please explain.
 
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think about that ...
1. JAX-RPC is created as same as Java RMI (in idea) .
When you have been created application with Java RMI, i think you will easy to create JAX-RPC application.
 
Juan Rolando Prieur-Reza
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Pradeep Bhat:

"...interface is stateless, so there would be no assurance that your created objects will be what you expect in subsequent invokations..."
can you please explain.


Pradeep,
As I began writng my answer, I realized that this question would be a nice opportunity to invite comment from Paul. So, I am going to start a fresh thread on this (that he is more likely to notice).
PS thanks for the questions
 
Pradeep bhatt
Ranch Hand
Posts: 8944
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

When you have been created application with Java RMI, i think you will easy to create JAX-RPC application.


Yes it is easy but we need to know why and what we are doing.
 
Try 100 things. 2 will work out, but you will never know in advance which 2. This tiny ad might be one:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic