Implementing TuxedoService and another remote interface

Happy New Year,
For some time Tuxedo has been the unique client of an EJB named "CustomerSignatureBean".
Tuxedo did invoke that EJB through the TuxedoService remote interface.
Now we need to access the same service from a Pojo (actually a delegate that is invoked from a Struts action). The TuxedoService.service(...) method, while being good for Tuxedo, is not very programmer-friendly.
Since we may not create new EJB implementations, we have decided to add the “checkSignature(...)” method to our EJB and reuse (refactor) the actual implementation, so that both service(...) and checkSignature(...) reuse the same implementation.
The problem is that we cannot invoke checkSignature(..) throught the TuxedoService interface.
Our solution is then to expose the same EJB through two remote interfaces: “TuxedoService” for Tuxedo client and (e.g.) "CustomerSignature" for normal Java EJB clients. In order to avoid interferences, we plan to pack both versions of that EJB in two different JARs (copying the same EJB implementation CustomerSignatureBean in both jars), and to resolve these interface through two different JNDI names (tuxedo.services.TuxedoCustomerSignature and ejb.customers.RemoteCustomerSignature)
Is there any problem with that solution?
Thanks,

Hi Yves,
I believe that should work just fine. We've had other customers doing similar things, i.e., reusing the same EJB implementation that is accessed via WTC and via RMI. I think the critical thing will be to get the deployment descriptors correct for each use.
Regards,
Todd Little
Oracle Tuxedo Chief Architect

Similar Messages

  • Cannot Implement an extension of Remote and another custom interface

    Hello All,
    I have one issue that though I thought it simple has become a real challenge to me
    I have an interface call RegistrationService which is has a certain number of method and is working fine but I need to expose a certain portion of it via a remote interface (RMI). So I thought that I would extend the RegistrationService to create a RemoteRegService which will also extend java.rmi.Remote. Not a problem to this point.
    Now some methods in the RegistrationService throw a custom exception InvalidAccountException, so my new interface looks like
    public interface RemoteRegService extends Remote, RegistrationService{}
    Then I create an implementation for the interface like
    public class RemoteRegServiceImpl implements RemoteRegService{
    @Override
    public void reviewAccount(HostAccount obj) throws InvalidAccountException, RemoteException{ //this
    Now the problem is that the code doesn't compile because the method reviewAccount in RegistrationService does not throw a RemoteException. And without the RemoteException, I cannot export my RegistrationService as a remote Object.
    Can someone give me a suggestion?
    Regards.

    use a delegate for the remote instance. it does need to be RegistrationService as it will only be consumed remotely. use an inner class constructed within the RegistrationService impl which just redirects remote method invocations to the appropriate local implementation.

  • Why is the stub generated from the implementation and not the interface?

    Why is the stub generated from the implementation and not the interface?

    Because if a remote server object implements multiple remote interfaces, its stub must implement all the same remote interfaces. The only way to know which interfaces to implement is to examine the server object class.

  • Home/Remote Interface and BeanName EJB in different Packages

    Hi all,
    I have a simple stateless session bean. Its Home and Remote interfaces are in X package and the BeanEJB in another. The files compile without any error. While I try to deploy it into J2EE ref implementation server using its deployment IDE, it throws up an rmic compilation error.
    Error Details
    File e:\j2sdkee1.3\repository\tejix\gnrtrTMP\POC2\General\SeabedHome_RemoteHomeImpl.java does not contain type General.SeabedHome_RemoteHomeImpl as expected. Please adjust the class path so that the file does not appear in the package General.
    General is the package where the remote/home interfaces are located and Bean1 is where the BeanEJB.
    Please suggest a solution
    Thanks in advance
    - Tejasvi

    I think that there is no problem in having the remote and home interface in different packages. Are you sure there is no conflit between classes? I had the same problem because i had repeated classes in the same package. I know this looks stupid but it really happened.
    miguel

  • Remote object trying to return another remote object and a ClassCastExcepti

    I have a server running with a TreeModel (the tree model implements Remote). I also have the the TreeNodes all linked together on the server. Now, I can get to the TreeModel on the server and the root node of the remote tree model.
    treeModelStub = (treeModelIface)Naming.lookup(url+"remoteTM"); //works
    rootStub = (remoteTreeNodeIface)treeModelStub.getRoot(); //works. The call to getRoot returns Object
    But when I call
    remoteTreeNodeIface aChild = (remoteTreeNodeIface)rootStub.getChildAt(index) //Does not work. "Exception in thread "main" java.lang.ClassCastException
    at remoteTreeNode_Stub.getChildAt(Unknown Source)
    The remote tree node method getChildAt returns TreeNode because the class implements TreeNode:
    public class remoteTreeNode extends UnicastRemoteObject implements rdcaDataIface, Comparable, TreeNode {
    public TreeNode getChildAt(int idx) {
    System.out.println("DEBUG: class is "+this.getClass()); // class is remoteTreeNode
    return (remoteTreeNode)children.get(idx);
    The remote interface is defined as:
    public interface rdcaDataIface extends java.rmi.Remote {
    public TreeNode getChildAt(int idx) throws RemoteException;
    Any ideas why this does not work. Why can a remote object of type Object be returned just fine, but a TreeNode not be returned?
    Thank you for your help,
    Brent

    I have a server running with a TreeModel (the tree
    model implements Remote). I also have the the
    TreeNodes all linked together on the server. Now, I
    can get to the TreeModel on the server and the root
    node of the remote tree model.
    treeModelStub =
    (treeModelIface)Naming.lookup(url+"remoteTM");
    //works
    rootStub =
    (remoteTreeNodeIface)treeModelStub.getRoot();
    //works. The call to getRoot returns Object
    But when I call
    remoteTreeNodeIface aChild =
    (remoteTreeNodeIface)rootStub.getChildAt(index)******************************************
    can only be casted to rdcaDataIface. The returned object is an instanceof the rdcaDataIface_stub, which have nothing to do with TreeNode.
    //Does not work. "Exception in thread "main"
    java.lang.ClassCastException
    at remoteTreeNode_Stub.getChildAt(Unknown
    t(Unknown Source)
    The remote tree node method getChildAt returns
    TreeNode because the class implements TreeNode:
    public class remoteTreeNode extends
    UnicastRemoteObject implements rdcaDataIface,
    Comparable, TreeNode {
    public TreeNode getChildAt(int idx) {
    System.out.println("DEBUG: class is
    lass is "+this.getClass()); // class is
    remoteTreeNode
    return (remoteTreeNode)children.get(idx);
    The remote interface is defined as:
    public interface rdcaDataIface extends java.rmi.Remote
    public TreeNode getChildAt(int idx) throws
    ows RemoteException;
    Any ideas why this does not work. Why can a remote
    object of type Object be returned just fine, but a
    TreeNode not be returned?
    Thank you for your help,
    Brent

  • ClassCastException at Remote object although remote interface is implemented

    Hi,
    I want to access a remote object via T3 (on WebLogic 10) but I am
    getting a ClassCastException in the client. The exception is thrown if
    the generic "Remote" object is casted into a concrete remote interface.
    The following works ok (client side, get remote object via JNDI):
    Hashtable hashTable = new Hashtable();
    hashTable.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    hashTable.put(Context.PROVIDER_URL, "t3://localhost:7001);
    ic = new InitialContext(hashTable);
    Remote r = (Remote) ic.lookup("...jndi bind name...");
    But this cast fails:
    IMyRemoteIntf i = (IMintRemoteIntf) r;
    The ClassCastException has the classname of the class which implements
    the remote interface - the lookup should be ok therefore. With
    r.getClass().getInterfaces() I have verified that the remote object
    actually implements the appropriate interface. I suppose it is a class
    loader issue then and added some debug output.
    Class loader parent chain of IMyRemoteIntf:
    weblogic.utils.classloaders.ChangeAwareClassLoader@1715ee2
    -> weblogic.utils.classloaders.GenericClassLoader@123ade0
    -> weblogic.utils.classloaders.FilteringClassLoader@1312cf9
    -> weblogic.utils.classloaders.GenericClassLoader@159ea8e
    -> java.net.URLClassLoader@82d37
    -> sun.misc.Launcher$AppClassLoader@e39a3e
    -> sun.misc.Launcher$ExtClassLoader@a39137
    Class loader parent chain of IMyRemoteIntf as reported by r.getInterfaces():
    sun.misc.Launcher$AppClassLoader@e39a3e
    -> sun.misc.Launcher$ExtClassLoader@a39137
    IMyRemoteIntf is in a jar file in WEB-INF/lib of my web application. I
    tried prefer-web-inf-classes = true in weblogic.xml as well as
    prefer-application-packages in weblogic-application.xml (with the
    respective package of the interface).
    Any ideas? I don't know what more I can try. I can access the same
    server with this t3 URL just fine from outside of the WebLogic server.
    Regards
    Werner

    I meant an issue about multi-connections. Although the socket is shared by all of the connections, each connection in RMI might correspond to a separated thread, I guess. Since the socket is shared by all rmi clients, the RMI channel would be a blocking connection. I am not sure if the RMI in JDK1.4 or above also use the nonblocking new I/O technique. Thanks.

  • Implement multiple remote interfaces

    Hi there, I wanted to write an RMI application with an remote object which implement two different remote interfaces, each has its own remote methods.
    eg:
    public class TestImpl implements Test1, Test2 {
    I only want to allow client to call the methods from Test1 remote interface (without Test2.class in the package). But exception NoClassDefFound of Test2 is caught. The reason I want to do like this is because I have a method in Test2 to unexport the remote object, call by server, so I want to hide it from client.
    I implement the system with Activation, but I couldn't unexport the TestImpl from somewhere else on the same activation group by using Activatable.unexportObject(..). I only can unexport it inside TestImpl remote object itself by calling Activatable.unexportObject(this, true); otherwise, NoSuchObjectException is caught.
    Thanks,
    Jax

    If X and A are in the same activation group, X can
    unexport A as long as it has a reference to the actual
    object A not its stub (because unexportObject() takes
    an impl not a stub).Yes, it's true that X can unexport A because there are within the same JVM. But the problem is I can't get the actual object of A.
    For example:
    // assume this code is within X
    ActivationGroupID agi = ActivationGroup.currentGroupID();
    ActivationDesc desc = new ActivationDesc(agi, "A", location, data);
    ActivationID id = ActivationGroup.getSystem().registerObject(desc);
    Remote remote = id.activate(true);
    The code above will only return a stub.
    Even if I use Activatable.register(desc), it returns a stub as well.
    How do I get the actual object?

  • My nephew lost the paired Apple TV remote and now I can't pair a new one with it.  How do I unpair the lost remote without pairing another remote?

    My nephew lost the paired Apple TV remote and now I can't pair a new one with it.  How do I unpair the lost remote without pairing another remote?

    See this official Apple article on how to unpair your remote with an Apple TV.
    http://support.apple.com/kb/HT1555?viewlocale=en_US&locale=en_US
    Let us know how this works for you.
    Also, are you positive the battery in your Apple TV remote is good?
    Never hurts to check or ask.

  • Location of stubs, skeletons, remote interface ,client and server files

    I have a question to the subject mentioned above :
    In a training example for RMI I red the following :
    .... stubs, remote interface and client files into
    client location
    ... skeletons, remote interfaces, server files and stubs
    into server location ....
    I understand that with the exception that the stubs must also be located at server side. My understanding is
    that it is enough if those reside only at client side. Is that
    right or wrong ?
    Thanks for your comment.
    Regards,
    Oskar

    The stubs must be available (in the classpath) on the server side. This is because when a remote server object is exported, the RMI runtime creates an instance of the stub (instead of the server) and sends it whenever a reference to the server is encountered. In order to create (and then serialize) the stub, its class file must be available on the server.

  • Is the remote interface implemented by some class

    Hi,
    I have a simple question, googled, no help.
    I am trying to udnerstand, where exactly is the remote interface implemented ?
    I mean, i know that it contains all the business methods which have a body in the bean.
    But is the remote interface implemented somewhere ? Is there any class which implements the Remote interface ?
    thanks
    S

    Sarvananda wrote:
    Hi,
    I have a simple question, googled, no help.look better...
    I am trying to udnerstand, where exactly is the remote interface implemented ?
    I mean, i know that it contains all the business methods which have a body in the bean. so, that's what implements it :)
    But is the remote interface implemented somewhere ? Is there any class which implements the Remote interface ?
    the bean class :)
    But the actual implementor is a class generated by the appserver that delegates to the bean class.

  • I have lost the remote that was paired. I bought another remote, but the procedure to pair the new one does not work. I suspect the the AT will work with only one remote at-a-time and i have to unpaid the first before pairing the second. How do I unpair?

    I have lost the remote that was paired. I bought another remote, but the procedure to pair the new one does not work. I suspect the the AT will work with only one remote at-a-time and i have to unpair the first before pairing the second. If this is true, how do I unpair? If not, what can I do?

    I was premature in posting the question. I found the answer in andother posting, and it was successful.
    Thanks, and sorry for the false alarm.

  • Pattern b/w Remote interface & Container implementation  class

    Which pattern is followed by EJB Remote interface & Container implementation class of that interface?Is there anyting mentioned in specs?
    This questoin was asked to me by many people.I think it is Command design pattern as it hides away all the details of actual business implementation.but at same time I doubt if it is Facade?
    Anyone who knows about this?
    Thanx in advance
    Sidhu

    Rarely is software represent a single pattern, it typically represents multiple patterns.
    Which pattern is followed by EJB Remote interfaceThe remote interface is an example of a facade pattern. This presents a public interface which is an abstraction of the real interface.
    Container implementation class of that interface? The implementation is an example of what I think of as a double proxy pattern. That is acting as two distinct proxies. The first being the the remote callingof EJB standard functions via the Skelton implementation. I.E. The underlying EJB/RMI interface. The Second being a application level proxying of the business logic seen in most RL implementation.
    The use of an UID ID beans is an example of a memento.
    I think it is Command design pattern as it hides away all the
    details of actual business implementation.Not directly, though an AppServer programmer may use the Command Pattern to resolve the remote connections. The User Application Programmer may also use this pattern. The key element of Command Pattern is the Invoker executing an concrete class via abstraction or interface of a polymorphic class. You can think of this as a specialisation of the
    Martin

  • Implementing generic and regular version of same interface

    I wanted to create a class that extends AbstractMap<Integer,Integer> and implements org.apache.commons.collections.BidiMap. BidiMap extends java.util.Map (not generic). I've gotten completely confused on how Java handles classes that implement multiple versions of an interface. Seems like you're not allowed to do it unless you introduce a layer of indirection. Even this is not really consistent
    public class A {
      public interface B<T> {public T a();}
      public interface C extends B {}
      public class D implements B<Integer> {public Integer a() {return 0;}}
      // Illegal
      public class E implements B<Integer>, C {public Integer a() {return 0;}}
      // why is this allowed?
      public class F extends D implements C {public Integer a() {return 0;}}
      public interface G<T> {public void a(T pArg);}
      public interface H extends G {public Object b();}
      public class I implements G<Integer> {public void a(Integer pInt) {}}
      // Illegal.  Huh?
      public class J extends I implements G {public Integer a() {return 0;}}
    }Anyone care to enlighten me on how this works? Is there any way to accomplish the original goal (extending AbstractMap<Integer,Integer> and implementing BidiMap)?

    I've gotten completely confused on how Java handles classes
    that implement multiple versions of an interface.It doesn't handle classes that implement multiple versions of an interface.
    why is this allowed?On my machine, it isn't.A.java:9: A.B cannot be inherited with different arguments: <> and <java.lang.Integer>
      public class F extends D implements C {public Integer a() {return 0;}}

  • Would it be possible to have 2 shared resources, one local containing all common topics and pictures for several projects, and another one remote containing all topics and pictures for collaboration purposes

    Hi,
    I was wondering, now that I discovered the advantages of Resource Manger, if it would be possible to have 2 shared resources, one local with common topics and pictures for several projects, and another one, remote, containing the whole projects, i.e. topics and pictures, for collaboration purposes.
    The local one I intend to use it for my purposes to have common items (topics & pictures) updated in all projects where they appear, and the remote one I intend to use it together with my remote colleagues that might want to do changes in the topics.
    This would mean that the common topics and pictures would be present in both resources, the local one as well as the remote one.
    Thank you.

    Thank you for your fast answer Rick.
    I was merely wondering if it would be possible w/o having to use other products outside RoboHelp.
    We are already using svn for a lot of other purposes and we are using that for the RoboHelp projects as well, however I was wondering if it would not be possible to have RoboHelp take care of the RoboHelp projects, and with svn to take care of the other things in the company.
    Eventually, if it would be possible, I would think to sync all the local projects with the remote projects, then sync the local project with the local shared resources, and at the end sync the rest of the projects with the local shared resources.

  • Implement a Mouse Listener and another Listener

    HI, i was wondering if it was possible to implement an Actionlistener and a Mouselistener at the same time, kind of like this (Syntax is impossible i know, but just to show a point)
    public class TrafficLight extends JApplet implements ActionListener and MouseListener ---You can't do it like that----, but if anybody knows how to actually do it, I would greatly appreciate it.

    When i do that, i get this error
    TrafficLight is not abstract and does not override abstract method mouseExited(java.awt.event.MouseEvent) in java.awt.event.MouseListener
    And i am doing this,
    public void mousepressed (MouseEvent e){
         }and this
    jLabel2.addMouseListener(this);I am probably forgetting somethig really simple.

Maybe you are looking for

  • Restore time machine to new hard drive?

    My hard drive just died and will need to be replaced. Once I have a new hard drive, how can I restore all the backed up contents onto my new drive? Thanks.

  • Upgrading from 10.4.11 to 10.5 Finder wont launch

    I updated my G5 from 10.4.11 to 10.5 using the default install on the 10.5 dvd. Trying to restart gets all the way to bkground pattern & applications visible in the dock & the clock working but it never gets all the way to launching the desktop. Just

  • Soundtrack Pro skipped during install

    Greetings: I recently upgraded to Final Cut Studio from the previous Studio version. Prior to installing the latest FCS, I had installed Logic Express 8. All went well with the FCS update, except for Soundtrack, which the installer simply skipped, an

  • Demo tables in Developer 6i

    In Oracle. Reports Developer, Building Reports Release 6 i online manual the demo exercises use following and many more tables: stock_history indcat VIDEO_CATEGORY_BY_QTR from where can I download its .sql file in order to get tables created and get

  • SpeedGrade crashes every time it is launched standalone and never works when using direct link from Premiere.

    SpeedGrade crashes every time it is launched standalone and when using Direct link to Adobe SpeedGrade from Premiere it only closes Premiere. It never try to even open SpeedGrade. All the effects have been removed and I have been successful with this