Daisy-chaining remote object calls

If you want to get data from a series of CFCs using remote
object, and each call depends on data received from the previous
call, you have to daisy-chain the functions making the calls,
otherwise there is no way to guarantee that the data is available
in time (in practice it is never available in time) because the
main thread races on regardless.
Now if you want to refresh parts of the data, or you want to
get a different set of data from one or more of the same CFCs, you
either can use the same functions and set up a different set of
daisy-chains with multiple boolean tests to see which chain of
links should be being followed ( and this ends up something akin to
a four-dimensional Hampton Court maze), or you have to duplicate
the remote calls over and over again in different sets of functions
and resultHandlers. Either way you end up with a horrible mess.
Is there any way to write a class that can suspend the main
thread, pending a remote call listener sending a resume main thread
event.
The other way that would work (though this would not be as
good) is to change addEventListener, so that you can pass arguments
into the resultHandler.
Does anyone have any ideas that could lead to a solution to
this problem? It's giving me gray hair.
Doug

"suspend the main thread, pending a remote call.." No. Can't
be done.
..."pass arguments into the resultHandler..." Yes, this is
done using the AsyncToken. (ACT pattern)
The send() methods returns an AsyncToken object. You can use
this dynamic object to add almost anything you want to the token,
including strings, and functions (google the term "closure").
As I am still not comfortable with anonymous functions, I
like to pass strings. I pass an identifier, which I can use in a
switch statement to determine the next step. Sometimes I pass a
"nextStep" string to define finer grain conditionality.
I use a single dataService object and result handler function
for all calls.
Tracy

Similar Messages

  • Two remote objects calls on the same php class

    Hi to all,
           I've encountered a strange issue while developing with remote objects.
    I've a mxml component with an init() method inside which is called by a menu.
    When the init() method is called it makes 7 remote object calls which are bound to some components' dataprovider.
    Among this calls I've got 2 remote object which refer to the same remote class. This because I have to call the class twice and the bind the result to two different combobox. Below you find the code:
    <mx:RemoteObject id="myFile" source="myRemoteClass" destination="amfphp"  showBusyCursor="true" makeObjectsBindable="true" fault="traceFault(event)"/>
    <mx:RemoteObject id="myXls"  source="myRemoteClass" destination="amfphp"  showBusyCursor="true" makeObjectsBindable="true" fault="traceFault(event)"/>
    in the init function I make this calls:
    myFile.listDir("dir_1")
    myXls.listDir("dir_2")
    then in the mxml code I bound the result of myFile to combobox1 and the result of myXls on combobox2.
    The problem arise when I call the myXls' listDir method. When I call it I receive the following error:
    code:
    Client.Error.DeliveryInDoubt
    Message:
    Channel disconnected
    Detail:
    Channel disconnected before an acknowledgement was received
    The strange thing is that not only the myXls object returns this error, but also all the other 6 remote object return the same error above.
    I'm not sure, but I guess that the error could be caused by the two remote object which call the same php remote class. If I comment one of the two calls everything works fine.
    Do you have any suggestion about?
    Thanks!!
    Bye
    Luke

    Hi Jan.
    1) We have the 2 VO, each with 3 rows to fill in data. What I mean is that when i just fill in all the fields for the first row of the first VO, and the value of one of these fields is bigger than 50, then after the exception is thrown and the message is displayed, the fields for the first VO are duplicated and shown in the second VO as if the user had inserted them.
    2) We tried yesterday the validateEntity and a Method and Atributte Validator approaches after reading that white paper with the same results.
    The validation is correctly done using any of the those methods.
    I will try to reproduce this issue with the HR schema.
    Thanks in advance once again.

  • Weblogic 10.3.0 issues with remote object calls.

    All:
    I was wondering if anyone has experienced any issues with Weblogic 10.3.0 dropping initial remote object calls over AMF Secure Channel. Here are the issues we are experiencing.
    1.     FLEX applications fail consistently on the first remote object call made across the AMF Secure Channel. Resulting in the request not returning from the application server; which has had varying affects on the different applications including missing data, application freeze and general degrading of the user experience.
    2.     FLEX applications require a browser/application refresh once the application has been inactive for a certain period of time. In our experiences the behavior occurs after 30 minutes of inactivity.
    I've deployed this same code to Weblogic 10.3.3 and the behaviors go away. Are there any patches to 10.3.0 that might take care of this issue that we are not aware of?
    Thanks for you help,
    Mike

    Hello,
    I found the problem. But I needed change the target of all my datasources until discover that one of my datasource didn´t answer and no errors was trigged.
    My server was waiting this datasource, and not get started.

  • EventListeners for multiple remote object calls

    Hi all,
    I have a Flex component that is displaying content from multiple (specifically two) remote object calls. I can call both remote methods, get the results back, pass them off to their respective ItemRenderers, etc. with no trouble. What I need, though, is a way to determine if I get no results back from either function call, to dispatch an event to trigger the next view state, and I don't know how to do that. Something like:
    protected function ticketConfigurationStateChangeHandler(event:Event):void
                   if(getPackagePromptsResult.lastResult.length == 0 && getTicketPromptsResult.lastResult.length == 0)
                         this.dispatchEvent(new Event("ticketConfigurationStateChange"));
                protected function ticketPrompts_creationCompleteHandler(event:FlexEvent):void
                    getTicketPromptsResult.token = registrationAPI.getTicketPrompts();
                    getTicketPromptsResult.addEventListener(ResultEvent.RESULT, showTicketConfiguration);
                protected function packagePrompts_creationCompleteHandler(event:FlexEvent):void
                    getPackagePromptsResult.token = registrationAPI.getPackageCPrompts();
                    getPackagePromptsResult.addEventListener(ResultEvent.RESULT, showPackageConfiguration);
    Any suggestions would be greatly appreciated...I know I need the event listeners to be able to get lastResult.length (and have it not be null) but I don't know how to set them up so I can automatically pass the user through the component and onto the next one if there are no results returned without having the user click a button or something similar on an otherwise blank component.
    Thanks in advance!
    ~ Amanda

    Hi all,
    I have a Flex component that is displaying content from multiple (specifically two) remote object calls. I can call both remote methods, get the results back, pass them off to their respective ItemRenderers, etc. with no trouble. What I need, though, is a way to determine if I get no results back from either function call, to dispatch an event to trigger the next view state, and I don't know how to do that. Something like:
    protected function ticketConfigurationStateChangeHandler(event:Event):void
                   if(getPackagePromptsResult.lastResult.length == 0 && getTicketPromptsResult.lastResult.length == 0)
                         this.dispatchEvent(new Event("ticketConfigurationStateChange"));
                protected function ticketPrompts_creationCompleteHandler(event:FlexEvent):void
                    getTicketPromptsResult.token = registrationAPI.getTicketPrompts();
                    getTicketPromptsResult.addEventListener(ResultEvent.RESULT, showTicketConfiguration);
                protected function packagePrompts_creationCompleteHandler(event:FlexEvent):void
                    getPackagePromptsResult.token = registrationAPI.getPackageCPrompts();
                    getPackagePromptsResult.addEventListener(ResultEvent.RESULT, showPackageConfiguration);
    Any suggestions would be greatly appreciated...I know I need the event listeners to be able to get lastResult.length (and have it not be null) but I don't know how to set them up so I can automatically pass the user through the component and onto the next one if there are no results returned without having the user click a button or something similar on an otherwise blank component.
    Thanks in advance!
    ~ Amanda

  • When  submit remote object call getting error Client.Error.DeliveryInDoubt

    Hello,
    We are having very weird error DeliveryInDoubt from blazeds.
    [ERROR] failed to call the remote service !!![FaultEvent fault=[RPC Fault faultString="Channel disconnected" faultCode="Client.Error.DeliveryInDoubt" faultDetail="Channel disconnected before an acknowledgement was received"] messageId="98F7B030-0FE0-0B88-300C-EC422D055E21" type="fault" bubbles=false cancelable=true eventPhase=2
    Error does not happen every time, but rather from time to time but happens on all client machines.
    Environment:
    blazeds v3.
    Flex application with Remote Object.
    Browser IE7.
    Object that passed to blazeds is complex and might have 100 items.But number of items does not seem affect error occurences.
    Short description for the object passed to blazeds remote object call for processing:
    Remote Object call takes an argument ArrayCollection of SyncRequest objects (_requestSyncList)
                    var syncRequest:SyncRequest = new SyncRequest();
                    var syncObject:Object = new Object();
                    syncObject[requestBuilder.direction] = requestBuilder.jobMap;
                    syncRequest.syncJobs = syncObject;
                    _requestSyncList.addItem(syncRequest);          
    requestBuilder.jobMap is an object that have different artifacts.
    jobMap[obj.artifact] = myColl;
    myColl is ArrayCollection of artifact of SyncJob
    Here is the definition of SyncJob
       public class SyncJob
            public var jobName:String;
            [ArrayElementType("com.farmers.docprocessing.remotesync.vo.JobParameter")]
            public var jobParams:ArrayCollection;
    Not sure what causing that issue and how to debug it. 
    Please advice.
    Thank you

    Not without you psoting some code.
    Possible problem: Difference between object type being returned, vs the type of the reference (i.e., the method that returns an object should have a return type of the interface name).

  • Simultaneous remote object calls in one http request?

    I am noticing when I have two remote object calls happen at the same time they are being bundled into one http request.  This is causing problems in my application becuase the result is not coming back until both have finished.
    So basically I have to calls that happen at the sametime.  One does not take anytime and the other is a long running task.  I will not get the result for the first until the long running task completes.
    Has anyone else seen this?
    Any help would be appreciated.

    "suspend the main thread, pending a remote call.." No. Can't
    be done.
    ..."pass arguments into the resultHandler..." Yes, this is
    done using the AsyncToken. (ACT pattern)
    The send() methods returns an AsyncToken object. You can use
    this dynamic object to add almost anything you want to the token,
    including strings, and functions (google the term "closure").
    As I am still not comfortable with anonymous functions, I
    like to pass strings. I pass an identifier, which I can use in a
    switch statement to determine the next step. Sometimes I pass a
    "nextStep" string to define finer grain conditionality.
    I use a single dataService object and result handler function
    for all calls.
    Tracy

  • Concurrent / Parallel remote object calls from same browser app

    Hello Everyone,
    I was wondering how remote requests made to blazeds get served by application servers, when it comes to serving multiple (parallel) remote requests coming from the same application in the same browser.
    Let us say that once you land on an application, you can fire-off 10 independent remote calls.
    Will they all be served by the same request thread in the application server one after another?
    I suspect this because the browser will really only maintain one duplex tcp/ip channel with the blazeds and therefore multiple requests should really just race to the server and get served one after another sequentially based on whichever gets their first.
    This is just what I suspect but I would like to find out from experts on the forum.
    Thanks,
    - Pulkit

    "suspend the main thread, pending a remote call.." No. Can't
    be done.
    ..."pass arguments into the resultHandler..." Yes, this is
    done using the AsyncToken. (ACT pattern)
    The send() methods returns an AsyncToken object. You can use
    this dynamic object to add almost anything you want to the token,
    including strings, and functions (google the term "closure").
    As I am still not comfortable with anonymous functions, I
    like to pass strings. I pass an identifier, which I can use in a
    switch statement to determine the next step. Sometimes I pass a
    "nextStep" string to define finer grain conditionality.
    I use a single dataService object and result handler function
    for all calls.
    Tracy

  • Remote Object call error...

    hi,
    i executed 'search' action for extracting data from database.
    and, i received error below.
    -code: Server.ResourceUnavailable
    -message: Cannot invoke method 'execute'
    This action is OK in Flash Player 9.x version, but occured error in Flash Player 10.x.
    How can i do fix that ?
    refer
    -Flex version : 2.0.x
    -FDS version : 2.0.x

    regardless of any other problems in your code, neither of the objects which you are subclassing from UnicastRemoteObject call the superclass constructor, which is a pretty basic flaw - in this case, it will lead to neither of these objects being exported properly.

  • How to call a function/event after a Remote Object's data is loaded?

    I'm making a call to a remote object that is loading a good
    amount of data. I've set up a "please wait" label that is supposed
    to display while the data is being loaded and then clear the label
    when the data finishes loading.
    At the moment I've got it set up like so...
    label = 'Loading data, please wait..."
    remoteObj.read.send();
    label = ''
    The problem with this is that the 'please wait' label doesn't
    even display because the actual call to the remote object I'm
    making finishes so quickly even though the data load does not. So
    what I need is possibly an IF statement to check if the data has
    finished loading. If it hasn't finished loading, the label stays in
    the "please wait" status, or if the data does finish loading, then
    the label clears out.
    What would be ideal is...
    remoteObj.read.send(); // gets the data
    if(data is loaded){
    label = '';
    }else{
    label = 'Please wait'
    I just don't know how to form the statement for the data
    loading in the IF statement.

    You are seeing the difference between data loading and UI
    rendereing.
    Reasonable amounts of data load very fast, expecially with
    RemoteObject. Bur rendering the UI is almost always the bottleneck,
    event with AS3 FP8+, which is about 30 percent faster than AS2!
    I have not found a perfect solution for this myself, but i
    think you will want to look into the component data events, to find
    one that fires after the component is actually rendered.
    Tracy

  • Tomcat shutdowing when remote object is calling secondtime from flex to blazeds

    Hi All,
    I am new to flex and started working on that.now i called one remote object from flex through blazeds.its working fine but when i call second time tomcat is  shutdowing .again if i start tomcat it is working fine.
    what is the problem does any one helps?
    sudheer

    Thanks for the tip Joe.
    It's not quite what I was looking for, but it gave me some ideas.
    The blog post describes how to create your own server to handle the file stream. With BlazeDS & Java EE app server there's no need to implement the low level stuff.
    One option would be to read the data on Flex side in chunks and make a request to send each chunk at a time, but I don't know whether this helps at all. Might just slow down the network.
    Another option is to write a custom adapter for BlazeDS endpoint, but I don't know enough details on this to say is it possible or not.
    Third option is to use regular servlet code and Apache Commons FileUpload module.
    Still interested hearing opinions from people working with BlazeDS.

  • DYNPRO_SEND_IN_BACKGROUND short dump in BW while calling Process chain remotely from APO

    Hi,
    While trying to call a process chain remotely from SCM APO system to SAP BW system - we are getting below short dump -
    Short text
        Screen output without connection to user.
    What happened?
        Error in the ABAP Application Program
        The current ABAP program "SAPLSDH4" had to be terminated because it has
        come across a statement that unfortunately cannot be executed.
    Checked the RFC connection between APO and BW system through SM59 and it is working fine - Can anyone pease suggest what configuration could be missing which might be causing this short dump.
    Thanks in advance.

    Additinal Data from Log -
    User and Transaction
        Client.............. 200
        User................ "AQ1ALE200"
        Language Key........ "E"
        Transaction......... " "
        Transactions ID..... "53F896E0992E0A50E10080000AF04150"
        Program............. "SAPLSDH4"
        Screen.............. "SAPMSSY1 3004"
        Screen Line......... 2
        Information on caller of Remote Function Call (RFC):
        System.............. "AQ1"
        Database Release.... 701
        Kernel Release...... 720
        Connection Type..... 3 (2=R/2, 3=ABAP System, E=Ext., R=Reg. Ext.)
        Call Type........... "synchronous and non-transactional (emode 0, imode 0)"
        Inbound TID.........." "
        Inbound Queue Name..." "
        Outbound TID........." "
        Outbound Queue Name.." "
        Client.............. 200
        User................ "KANDIS"
        Transaction......... "RSPC"
        Call Program........."SAPLRSPC_PROCESSES"
        Function Module..... "RSPC_DESTINATION_F4"
    Call Destination.... "BQ2CLNT200_DIALOG"
    Error analysis
        During background processing, the system attempted to sen
        screen to a user.
        Current screen: "SAPMSSY0 " 0120.
    How to correct the error
        If the error occurred in your own ABAP program or in an SAP
        program you modified, try to remove the error.
        If the error occures in a non-modified SAP program, you may be able to
        find an interim solution in an SAP Note.
        If you have access to SAP Notes, carry out a search with the following
        keywords:
        "DYNPRO_SEND_IN_BACKGROUND" " "
        "SAPLSDH4" or "LSDH4F09"
        "DISPLAY_LIST"
    Information on where terminated
        Termination occurred in the ABAP program "SAPLSDH4" - in "DISPLAY_LIST".
        The main program was "SAPMSSY1 ".
        In the source code you have the termination point in line 2205
        of the (Include) program "LSDH4F09".

  • Error passing a remote object in a rmi function call

    Hi,
    I've a problem passing an UnicastRemoteObject extended object in a rmi function call. I get the following error
    java.lang.IllegalArgumentException: argument type mismatch
    I've 2 Remote Objects: GalaxyRegistration and Station. I want to pass a Station Object as argument in a function from GalaxyRegistration. Does anyone know what the problem is?
    Here is the code:
    public class GalaxyRegistration
    extends UnicastRemoteObject
    implements GalaxyRegistrationInterface, Galaxy {
         public GalaxyRegistration() throws RemoteException {
         public void add(Station station) throws RemoteException {
              stations.addElement(station);
              System.out.println("Add Station " + station.getName());
    public class Station
    extends UnicastRemoteObject
    implements StationInterface {
         SystemInfo system;
         public Station(String name, String description, Coordinate position, Profile profile)
    throws RemoteException {
              system = new SystemInfo(name, description, position, profile);
    public class StationServer {
         Station station;
         public void run() {
              // create new Station
              System.out.println("Create new Station:");
              // register and bind new station
              try     {
                   station = new Station(name, descr, location, profile);
                   System.out.println("Station created ...");
                   GalaxyRegistrationInterface registry =
                             (GalaxyRegistrationInterface)
                             Naming.lookup
    ("//localhost/GalaxyRegistration");
                   System.out.println("Registry looked up ...");               
                   // >>>>>>>> NEXT LINE IS THE ERROR LINE <<<<<<<<<<<<<<     
                   registry.add(station);
              } catch(Exception e) {
                   System.out.println(e);
    }

    regardless of any other problems in your code, neither of the objects which you are subclassing from UnicastRemoteObject call the superclass constructor, which is a pretty basic flaw - in this case, it will lead to neither of these objects being exported properly.

  • $25 Reward - Calling a CFC via Remote Object or Web Service without making the result public

    I am just getting into Flex 2, so please forgive me for my
    newbe vocab.
    Here is how my applications have worked in the past, i.e.
    ColdFusion:
    <cfscript>
    //Create an instance of component
    order = CreateObject( 'component', 'PEK.Catalog.Order' );
    //Call methd
    theOrder = order.getOrder(1234);
    </cfscript>
    Display the order via HTML and CFML.
    getOrder() returns a query and 1234 is a sample orderID. The
    most important part of the solution I am looking for is that the it
    must not expose my getOrder() as a public web service. I am able to
    run the application with WS by making the mothod URL visible and
    remote, but this is no way near the security I would like to have.
    Here is my folder structure where components folder has been maped
    to CF.
    Application
    |__extentions
    | ... |__components
    | ... ... |__PEK
    |__wwwroot
    I guest there should be a way to call CFC with the thing
    remote object that I have no idea how to set up. So please what
    would be a solution to my security issues.
    Thank you in advance!

    Click
    Here for Link to Article
    I guess this article answers part of the question. It is very
    important to note that if the CFC is sitting on the same server as
    the CFC the component methods could be public and not remote, thus
    making it alot more secure.

  • RMI and Threads: Calling wait() on a remote object

    I created a counter as a remote object.
    Multiple clients are displaying the counter value.
    If one of the clients increments the counter, I want the displayed counter value on every client to be updated to the new value (of the counter on the server).
    Therefore every client starts a new thread to "listen" for changes of the countervalue. I wanted to call the wait() method on the remote object (the remote counter). But i think it will be called on the stub instead of on the actual remote object.
    Therefore i created a extra method waitForChange() on the remote object.
    public void waitForChange() throws RemoteException, InterruptedException {
         synchronized(this) {
              wait();
    This method only calls the wait() method. Now I'm sure it's called on the remote object and not on the stub.
    This works, but my question is: is there a better way to do this?
    Code:
    ==========================================
    The remote interface
    ==========================================
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    public interface RemoteCounter extends Remote {
         void incrementCounter() throws RemoteException;
         int getCounterValue() throws RemoteException;
         void waitForChange() throws RemoteException, InterruptedException;
    } ==========================================
    The implementation of the remote interface
    ==========================================
    import java.rmi.*;
    import java.rmi.activation.*;
    import RemoteCounter;
    public class RemoteCounterImpl extends Activatable
         implements RemoteCounter {
         private static final long serialVersionUID = 1L;
         private int counter = 0;
         protected RemoteCounterImpl(ActivationID id, MarshalledObject data) throws RemoteException {
              super(id, 0);
         public void incrementCounter() throws RemoteException {
              synchronized(this) {
                   counter++;
                   notifyAll(); //Inform all clients of the new countervalue;
         public void waitForChange() throws RemoteException, InterruptedException {
              synchronized(this) {
                   wait();
         public int getCounterValue() throws RemoteException {
              return counter;
    }==========================================
    A piece of code registering the remote object
    ==========================================
    ActivationDesc desc = new ActivationDesc(agi, "RemoteCounterImpl", codebase, data);
    //Register with rmid
    RemoteCounter counter = (RemoteCounter)Activatable.register(desc);
    // Bind the stub to a name in the registry running on 1099
    Naming.bind("Counter", counter);==========================================
    The panel containing a button, a label
    which starts a new thread listening for
    counter value changes
    ==========================================
    import javax.swing.*;
    import java.awt.Dimension;
    import java.awt.event.*;
    import java.rmi.*;
    import org.personal.exam.services.RemoteCounter;
    public class PanelCounter extends JPanel {
         private static final long serialVersionUID = 1L;
         JLabel labelX = new JLabel("Press testbutton");
         Thread t;
         RemoteCounter remoteCounter;
         public PanelCounter()     {
              try {
                   jbInit();
              } catch(Exception e) {
                   e.printStackTrace();
         private void jbInit() throws Exception
              this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
              this.setPreferredSize(new Dimension(450,300));
              // The securityManager is required to make is possible
              // to download classes from the server
              if (System.getSecurityManager() == null) {
                   System.setSecurityManager(new RMISecurityManager());
              //Create a testButton to increment the counter          
              JButton testButton = new JButton("Increment");
              testButton.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent arg0) {
                        incrementCounter();
              this.add(testButton);
              //Add a label to display the counter value
              this.add(labelX);
              // Create thread to listen for counter value changes
              try {
                   remoteCounter = (RemoteCounter)Naming.lookup("Counter");
                   CounterValueChecker cvl = new CounterValueChecker(labelX, remoteCounter);
                   //Start a thread to listen for changes of the countervalue
                 t = new Thread(cvl);
                 t.start();
              } catch(Exception e) {
                   e.printStackTrace();
              this.setVisible(true);
         private void incrementCounter() {
              String message = "error";
              try {
                   remoteCounter.incrementCounter();
                   message = "Current value is " + remoteCounter.getCounterValue();
              } catch(Exception e) {
                   System.out.println("Test Exception: " + e.getMessage());
                   e.printStackTrace();
              labelX.setText(message);
    }==========================================
    The runnable implementation used by the
    thread to wait for counterchanges
    ==========================================
    import java.rmi.RemoteException;
    import javax.swing.JLabel;
    import org.apache.log4j.Logger;
    import RemoteCounter;
    public class CounterValueChecker implements Runnable {
         private JLabel counterLabel;
         private RemoteCounter remoteCounter;
         public boolean keepChecking= true;
         private Logger logger = Logger.getLogger(this.getClass());
         public CounterValueChecker(JLabel counterLabel, RemoteCounter remoteCounter){
              this.counterLabel = counterLabel;
              this.remoteCounter = remoteCounter;
         public void run() {
              while(keepChecking) {
                   int newVal = -1;
                   synchronized(remoteCounter) {
                        try {
                             //remoteCounter.wait();
    //this does not work. I think because the wait() method is called on the
    //stub instead of on the actual remote object
                             remoteCounter.waitForChange();
                        } catch (InterruptedException e) {
                             keepChecking = false;
                             break;
                        } catch (RemoteException re) {
                             re.printStackTrace();
                        try {
                             newVal = remoteCounter.getCounterValue();
                        } catch (RemoteException re) {
                             re.printStackTrace();
                        counterLabel.setText("New value: " + newVal);
    }This is just a little test. Actually I want to notify clients of changes in data displayed in a Table. If one client saves one record of the data, i want the new record to be displayed immediatly on all clients that are viewing the same data.

    I've been doing some reading about RMI and callback.
    As I understand it, there's a remote object is running on the client now as wel. And the server makes a call to the client.
    But now the server makes a call to one client.
    And the point is, I want all clients to be updated with the new value.
    Does this mean, I have to keep a list with references to all clients connected to the server?
    I my code the notifyAll() method causes all waiting Threads (running on several clients) to wake up and do something (getting the new counter value).

  • 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

Maybe you are looking for

  • Can't get video podcast to show up on my iPod

    I've downloaded tv programs, even compressed some of my own video work and put it on my iPod....but for some reason, the 3 video podcasts I downloaded don't show up after my iPod updates. I searched in the music section as well as the video section u

  • Flash 10 in Director 11 (import)

    Hello! I want to include a Flash 10 -file (swf) in Director 11. When I do this, Director dont play the SWF. A Flash 9-file works without problems. What can i do?

  • Check partner authorization field

    Hello Gurus,        The check partner authorization field is used to determine which partners are authorized to release against a contract. Should no check be performed, you may leave the field blank. where to set this check partner authorization fie

  • Can you take a snapshot or picture from IMovies?

    Can you take a snapshot or picture from IMOVIES? On my PC I simply paused the video and hit something that said snapshot and it was done. I am struggling a little bit with IMOVIES as I have never had APPLE before. Like it, but am new to it.

  • How can I add keywords for SEO into the code?

    How can I add keywords (for SEO) into the code of a Muse designed site?