To call methods inside the same application is possible to use RMI ?

hello,
What I should like to know is if RMI can easily be used to implement comunication (calling methods) inside classes that are part of the one same application... This should be a restrict case to use RMI...
The reason to do it come from the need to use the instance of a class knonwing it only as Object... This can be good to do if some code is used for general pupose in many different contexts.
In this case you can pass to the "server class" a parameter 'o' of type Object (all the classes extend Object) of the "customer class" to get back informations if some elaboration happen inside the "server class"...
This purpose is generally implemented with event listeners, but perhaps it could be done easily using RMI too (I dont know it...).
Using RMI in this simple situation, don't should require anything of complicate (stub, .... mashalling parametres....) to have the reference to method of the "customer class" to call. The "server class" already recives a reference of the "customer class" how parameter of type Object, and the mame of the method too.
I propose a simple thoeric example to explain really what I said before:
Class Server {
    String methodName;
    Object obj;
    pubic Server( Oject o , String metName){  // constructor
        obj = o;
        methodName = metName;
        // some thing is done and, at last, the method callbakMethod() is executed
        callbakMethod();
    }// constructor
    public void callbakMethod(){ // this method have the purpose to call customerMethod()
          Class c = owner.getClass();                            
          Method m = null;
              try {
                      m = c.getMethod("callBackMethod",null);     
                     * // (1)
                      // I think that here we could have the possibility to call
                      // the method  customerMethod() belonging to class Customer..
                      // I don't know if it possible and  ...  (and if it is possible) I am not able to do it*
    }// callbakMethod()
}  // class Server
Class Custmer{
    public Customer() { // constructor
          Server s = new Server (this, "customerMethod");
    } // constructor
    customerMethod() {    // I would this method is called from class Server
        // do some thing.....
    }  //customerMethod
}  // class CustomerMy ask is: it is possible to call customerMethod() from the Server class ?...
If the aswer is yes, I wold know the sintax to use to do it, please.
thank you
regards
tonyMrsangelo

RMI doesn't help you in the slightest here. You can just realize it all using local method invocation. All RMI does is to make that remote. If the objects aren't remote there is no point.

Similar Messages

  • How do I call methods with the same name from different classes

    I have a user class which needs to make calls to methods with the same name but to ojects of a different type.
    My User class will create an object of type MyDAO or of type RemoteDAO.
    The RemoteDAO class is simply a wrapper class around a MyDAO object type to allow a MyDAO object to be accessed remotely. Note the interface MyInterface which MyDAO must implement cannot throw RemoteExceptions.
    Problem is I have ended up with 2 identical User classes which only differ in the type of object they make calls to, method names and functionality are identical.
    Is there any way I can get around this problem?
    Thanks ... J
    My classes are defined as followes
    interface MyInterface{
         //Does not and CANNOT declare to throw any exceptions
        public String sayHello();
    class MyDAO implements MyInterface{
       public String sayHello(){
              return ("Hello from DAO");
    interface RemoteDAO extends java.rmi.Remote{
         public String sayHello() throws java.rmi.RemoteException;
    class RemoteDAOImpl extends UnicastRemoteObject implements RemoteDAO{
         MyDAO dao = new MyDAO();
        public String sayHello() throws java.rmi.RemoteException{
              return dao.sayHello();
    class User{
       //MyDAO dao = new MyDAO();
       //OR
       RemoteDAO dao = new RemoteDAO();
       public void callDAO(){
              try{
              System.out.println( dao.sayHello() );
              catch( Exception e ){
    }

    >
    That's only a good idea if the semantics of sayHello
    as defined in MyInterface suggest that a
    RemoteException could occur. If not, then you're
    designing the interface to suit the way the
    implementing classes will be written, which smells.
    :-)But in practice you can't make a call which can be handled either remotely or locally without, at some point, dealing with the RemoteException.
    Therefore either RemoteException must be part of the interface or (an this is probably more satisfactory) you don't use the remote interface directly, but MyInterface is implemented by a wrapper class which deals with the exception.

  • Different CONFIG in the same application

    Hi,
    I am quite new on Forms World and I am having some problems on using the
    Forms configuration below listed. Can anyone help me on this issue?
    I have:
    * http://mydomain.com/forms/frmservlet?config=application1
    This address open my application without any problems!
    * http://mydomain.com/forms/frmservlet?config=application2
    This address also open my application without any problems!
    But, I need, from the first application string (http://mydomain.com/forms/frmservlet?config=application1), to call one particular FORM using the config=application2 .
    How can I do that?
    Thanks a lot,
    Paulo.

    I don't believe there is a native way to do this in Forms.
    Please correct me if I am wrong but I think:
    You can use the web.show_document method but this would not be the same as using call_form or any of the other built-ins. As long as you don't need access to any :global's created by the calling form inside the called form and vice versa you should be ok. This will also require you to login a second time if the username isn't specified in the 2nd config unless you have programmed the form to not require a database connection or it connects on it's own.

  • Hi How do we create Methods inside the Business objects of Z

    Hi Abapers,
                        How do we create Methods inside the Business objects (z objects) and how *** an import parameter or export parameter  to be defined for the new Methods.
    Regards
    Bhaskar Rao.M

    Hi Bhaskar,
    that ´s not difficult.
    Open your Bus.Obj. in SWO1 with CHANGE/EDIT
    Click on the "Methods" header line and then use the button for "Create".
    If you want to add the method on basis of a function module, choose next in the next pop up. Then the system will offer you the ex/import parameter from the function module. So this is a really simple way.
    If you don´t have a FM, it is a little bit more difficult.
    Choose No on the quetion about a FM, fill in the next pop up  methode name (no blanks allowed).
    Dialogue is for user related method (call screen...) synchronous for methods which have to give back a result directly in to the workflow.
    After completing the screen the method will be displayed as new method at the end of method list. Now add parameters (first click on the method name, then choose parameter button, same functionality to add program to the method).
    Programm:
    Code snip:
    BEGIN_METHOD ZWFCHECKMIRO CHANGING CONTAINER.
    DATA:
          ZBELNR TYPE RBKP-BELNR,
          ZGJAHR TYPE RBKP-GJAHR,
          RESULT TYPE HRP1001-ISTAT,
          BELNR TYPE BKPF-BELNR,
          GJAHR TYPE BKPF-GJAHR,
          BUKRS TYPE BKPF-BUKRS.
    to import parameter
      SWC_GET_ELEMENT CONTAINER 'Zbelnr' ZBELNR.
      SWC_GET_ELEMENT CONTAINER 'Zgjahr' ZGJAHR.
    *(or SWC_GET_TABLE)
    here add the functionality of your method!
    to export parameter
    SWC_SET_ELEMENT CONTAINER 'Result' RESULT.
      SWC_SET_ELEMENT CONTAINER 'Belnr' BELNR.
    *(or SWC_SET_TABLE)
    !!! Important: naming convention!!! Use same writing of parameter names in
    PARAM area (button PARAMETER) and here in code.
    To use your method, change it to implemented after adding your code.
    -> Edit -> Change release status -> object type component -> into implemented
    (Sorry , have a german screen here, possibly terms are a little bit different.
    Hope this helps a little bit.!
    regards
    Dirk

  • How do multiple developers share the same application module

    Is there a suggested method for multiple developers to share the same application module? We have 2 developers that will have EOs in the same directory and would like to know how they can share an application module but do development on different pieces of a project.
    Thanks,
    Paula

    Try using CVS or any other source control system. Still there are some points to think about before doing big projects, because there are many files which are updated by JDEV without knowledge by the developer. This causes many conflicts using a version control system like CVS.
    If you developers both are working on the server part of the application, I suggest using multiple application modules. See this blogs:
    http://radio.weblogs.com/0118231/stories/2005/05/27/howGranularShouldMyApplicationModulesBe.html
    http://radio.weblogs.com/0118231/stories/2005/07/19/nestedApplicationModules.html
    On the client side it depends on which technology you are using (struts, swing, jsf, ...).

  • Applet with 2 methods with the same name in ie

    Hi,
    I have a problem with the Java 1.5 plugin for Internet Explorer .
    When my Applet contains 2 methods with the same name but not the same return type, ie does not take the good return type.
    Here is an exemple :
    * Class TestApplet
    package test.applet;
    import java.applet.Applet;
    public class TestApplet extends Applet {
         public void init() {
              System.out.println("init()");
         public void start() {
              System.out.println("start()");
         public String test(String s) {
              System.out.println("test(String) :" + s);
              return s;
         public boolean test(int i) {
              System.out.println("test(int) :" + i);
              return true;
    }I have 2 methods test(), one returns a String and the other a boolean.
    I use the following html code :
    <html>
    <head>
    <script>
    function test() {
         alert(document.DataAccess.test("hello"));
    </script>
    </head>
    <body>
    <applet WIDTH="500" HEIGHT="200" ID="DataAccess" NAME="DataAccess" CODE="test.applet.TestApplet">
    </applet>
    <div onclick="test()">test</div>
    </body>
    </html>
    When I click on "test", the alert show "true" instead of "hello".
    The problem only occurs with a JVM 1.5. It work fine with JVM 1.4.
    Any idea ? Is it a bug ?
    Thanks.

    In your javascript method:
    function test() {
    alert(new String(document.DataAccess.test("hello")));
    MSJVM and SUN jre use different conversion from javaScript objects to Java.
    if you call from javaScript:
    document.getElementById("myApplet").myMethod(22);
    The method in MSJVM should look like this:
    public whatever myMethod(Double d);
    and SUN jre:
    public whatever myMethod(Integer i);
    The best thing to do is this:
    public whatever myMethod(Object o);
                   int col = 0;
                   if (o.getClass().getName().toLowerCase().indexOf("integer") != -1) {
                        col = ((Integer) o).intValue();
                   } else {
                        col = ((Double) o).intValue();
                   }

  • CAll method inside layout

    Hi all,
             how can we call method inside Layout

    Hi,
    Layout is used for designing,
    Code can be written in eventhandler, you can call the methods in eventhandler.
    Please refer the following links for more information.
    [Layout|http://help.sap.com/saphelp_nw70/helpdata/en/e6/a85e3ba69d493ce10000000a11402f/content.htm]
    [Event Handler|https://wiki.sdn.sap.com/wiki/display/BSP/EventHandlersin+BSP]
    Hope this helps you.
    Regards
    Rajani

  • How to install several instances of the same application on a computer?

    Hej,
    I have an application in LV 2009, where I have created an installer. The installer installs to a directory called \Receiver relative to the Program Files directory. If I install this once to a computer, everything is OK.
    However, I want to install the same application twice on the same computer. There should be no conflicts between the two applications, since I can configure them to work on different directories and ports. But if I call the installer again, and selects another directory, nothing is installed and I get the message "Installation Summary - No software will be installed or removed". It seems like the installer ignores that I have selected another directory, and just uses the default directory, relative to the Program Files directory.
    Anyone knows the trick, how to install several instances on the same computer ?
    BR, Jan
    Jan Nielsen
    Freelance system analyst and LabVIEW programmer

    Hi Jan,
    This is so because each installer has a GUID that is used to check whether the application needs to be upgraded or not. (It's a Microsoft function).
    What you can do is create a new installer with a different GUID (copy the installer in the projects), and check witha  text editor whether this GUID has changed.
    But any specific reason you need two seperate installs? You can run the application twice with a specific INI token:
    allowmultipleinstances=True
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Send data via PI to a proxy inside the same PI system?

    Hi,
    I want to transfer data send to PI to several other applications and in addition to the same PI system. Therefor I thought PI proxy technology would be the best but. When I send the data to the PI proxy I will get an infinity loop.
    So I want to do the same what is possible with IDOC scenarios. I found an article telling me that I need to set up a different client inside the PI system and configure this client as Application System and not as PI inside sxmb_adm.
    But this does not work and I never found this article again.
    Any ideas?
    BR Markus

    >
    Jan-Markus Wilhelm wrote:
    > Hi,
    > I want to transfer data send to PI to several other applications and in addition to the same PI system. Therefor I thought PI proxy technology would be the best but. When I send the data to the PI proxy I will get an infinity loop.
    >
    > So I want to do the same what is possible with IDOC scenarios. I found an article telling me that I need to set up a different client inside the PI system and configure this client as Application System and not as PI inside sxmb_adm.
    > But this does not work and I never found this article again.
    >
    > Any ideas?
    >
    > BR Markus
    the only way, yes is to have a different client which is configured as the application system.
    if you look into this blog it shows two different client of the XI system interacting with each other...
    yours will be similar /people/ravikumar.allampallam/blog/2005/03/14/abap-proxies-in-xiclient-proxy

  • How to active more than one front panel in the same application ?

    Hello,
    I want to active several front panels in the same application. I am a recent labview's user and it's difficult to solve this question.
    Thanks for your help.
    Regards

    But, each VI, including each subVI has a front panel. If you want several front panels, that implies using several VIs. The top level VI will call the appropriate subVI. Each subVI that you need as a UI can be set to 'Show front panel when called' and 'close afterwards if originally closed'. These settings can be accessed through popping up on the VI's icon and selecting VI Properties..., then selecting Window Appearance, then selecting the customize button or the dialog radio button.
    Hope that this helps,
    Bob
    Bob Young - Test Engineer - Lapsed Certified LabVIEW Developer
    DISTek Integration, Inc. - NI Alliance Member
    mailto:[email protected]

  • Associate 2 Standard Tab Sets to the same application page

    Can you associated 2 Standard Tab Sets to the same application page and only have one of the Standard Tab Sets display based on an item value on that application page?
    Thanks,
    Dan

    Hi Dan,
    to my knowledge you can't do that, because you can only assign one tab set with the page property "Standard Tab Set".
    But how about just creating one tab set where you conditionally display the tabs which are matching?
    Patrick
    My APEX Blog: http://inside-apex.blogspot.com
    The ApexLib Framework: http://apexlib.sourceforge.net
    The APEX Builder Plugin: http://sourceforge.net/projects/apexplugin/

  • For existing data in BI, client need to take a call to park the same from s

    hi,
    friends,
    For existing data in BI, client need to take a call to park the same from safety point view by copying the existing ODS  
    is it possible?if it is possible give me details.
    thanks&regurds
    sivaji

    hi,
    well when you copy an ODS only the structure is copied. to load the data you might need to create transformation and DTp to load data in the new ODS.
    You need to load data manually. Copying the ODS will only copy the structure.
    Regds,
    Shashank

  • Using EE and XE in the same application?

    After reading the license, it doesn't appear that there is any stipulation against using XE databases alongside an EE database within the same application.
    I have a business app which runs with a centralized database, but clients in many geographically dispersed locations. The idea has been bumped around lately of trying to cache data locally to speed things up. The approach is not so much replication, but of acquiring modification priveleges from the central database, making a copy of the relevant data to a local one, and working with it there for a time. Modifications are then copied back into the central database. This scheme would be aimed at improving response times, and also helping increase the scalability of the overall application. (And yes, our applicaiton adheres strongly to the principle of locality.)
    Thus far, we acquired licenses to BerkeleyDB in order to implement these local data repositories. Oracle XE seems like a more effective route because it presents the immediate benefit that the application would not need to have it's OCI code changed..
    Given that XE supports replication as a client, I hope that this sort of thing has already crossed the minds of Oracle and that it is an acceptable use of XE?

    I am not from Oracle but I cannot see anything in your use case that would violate the license agreement. The usage of XE is free for any purpose and you are allowed to use database links, export / import and even create materialized views from another oracle database directly.
    Regards,
    ~Dietmar.

  • How can i deploy two different versions of the same application on the same server??

    I have two different versions of an application. One is a released version. And another version under development. I need to port this version of the application to the same server. I'm using the same classes and packages(except for some new ones). Is it sufficient if i change the name of my ear(application name). Or should i change my code also.

    Hi
    You can repackage the new versions of ear,jar and war with different names. I hope that should work well.
    Cheers
    -pradeep

  • Multiple developers working on the same application/project

    Hi All,
    We have multiple developers working differnt components of the same application/project. As most of them are working on their local systems within their local projects which later has to be integrated as one application project I am afraid the integration would be a big challenge.
    Can someone suggest a way this can achieved without much additional effort and code/ functionality loss.
    Best regards,
    Divya Rao

    Hi Divya,
    I this can be accomplished by using JDI.This helps in easy integration ,version and change management.
    For more details refer to:
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/03/f6bc3d42f46c33e10000000a11405a/frameset.htm">SAP Help</a>

Maybe you are looking for

  • Headless macPro screen resolution

    So of this info maybe useful to some, but I'm hoping others maybe able to improve on it. On this headless system I connect via screen sharing. The problem is the resolution is I think limited to 800 x 600 or similar without any screen plugged in. Now

  • PKGs in /Library/Receipts

    Hi Community, I read a lot of tutorials and storys about the sense and nonsense of the repair_permissions feature. I followed the trace of the mechanism in my filesystem and I'm surprised why I can find only a half dozed PKGs in the folder /Library/R

  • Understanding Dynamic Navigation iview.....

    In MSS, I have the following workset in my role... ->Team (workset)    ---+ Team (webdynpro proxy page)    ---+ Employee information (folder)    ---+ Employee Working Time (folder)    etc.... The "Team webdynpro proxy page" has an iview ,"Services",

  • BC4J Client Data Model Definition Wizard does not dismiss

    I'm a newbie trying to learn JDeveloper on my own to advance my career. I am following examples given in the Oracle9i JDeveloper Handbook by Koletzke, Dorsey, and Faderman. Everything has worked great so far until now. With the BC4J Client Data Model

  • Sync Group stuck in 'Processing'

    Can you please reset the following sync group: Status Processing Sync Group ID 3f3f4612-b850-4b5a-bcd0-e0db7c0d9ce7_East US Location East US Subscription ID ca240b2a-97d7-4de8-a7e2-510fe4458740