coder
coder

Reputation: 1445

Invoking EJB with changed interface

Today I made some experiments with EJBs.

JavaEE 6

Websphere 8.0.x

I have an interface defining some remote methods:

interface Calculator{
  int add(int x, int y);
  int mul(itn x, int y);
}

This interface is implemented by an EJB.

Furthermore I have another EJB calling the Calculator-EJB from another application (ear). So in total I deployed two ear files, everything works fine.

Now I changed the Calculator interface, I dropped the mul-method, but in the implementing EJB class the mul-method is still implemented, I just removed the @override annotation. Now I redeployed the ear with the EJB implementing the changed interface.

To my surprise the other ear application is still able to invoke the mul-method.

Is this part of the EJB standard?

After that I renamed the Calculator interface to Calculator2 and redeployed the EJB implementing this new interface.

The other ear application, which only have the old Calculator interface, is still able to invoke the methods on the newly deployed EJB which implements just the new Calculator2 interface.

Same question: Is this part of the EJB standard?

Upvotes: 1

Views: 46

Answers (1)

wfink
wfink

Reputation: 357

This should be the "No interface view" of the EJB3.1 specification.

All methods that are public for a EJB can be accessed without an interface. But I'm not sure whether you can have the NoInterfaceView in parallel with the Interfaces, that might not acording to the spec.

Upvotes: 1

Related Questions