Refreshing All Clients  when an Event Happens at Server

I have web application in which some pages/entities should be viewed by only one user at a time. when a user moves to a new page that event should be broadcasted to all other clients , giving access to that page for all other users.
i have developed this appln. in JSP and Servlet .
Can any one please help me with an efficient logic for this ...
Thanks in advance

sorry for the late relpy.....
i hope it will work...let me try ...

Similar Messages

  • How can i trigger workflow when particular event happens in webdynpro

    how can i trigger workflow when particular event happens in webdynpro

    hi,
    To trigger workflow , use the fm : 'SAP_WAPI_START_WORKFLOW'
    Refer this thread for similar requirment : Workflow in WebDynpro
    Blog : http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417500)ID1564403950DB00699140435432809306End?blog=/pub/wlg/2778

  • How to get the IP of the client when TCP connect in the server

    How to get the IP of the client when TCP connect in the server.
    The only parameter got from the connection is connectionID.
    Solved!
    Go to Solution.

    I guess you're using "TCP Wait on Listener" on the server. This returns the remote address and port (as optional outputs).

  • Query not refreshing all data when run in workbook with other queries

    All,
    I have the following problem. I have a workbook that has two queries, one on each tab.
    The specific thing I notice that the company code is not showing up in the query at first until I hit refresh. Both queries use the same company code and user variables. When running the workbook I have each query set to "refresh query when running workbook". I have been able to duplicate this problem in either of the two queries, depending upon which company code variables I use. When I run the workbook, one of the two queries never updates company code variable unless I "refresh" the query directly after pulling up the workbook.
    I have changed the company code variable and used other company codes in each query, some required, some not, but ultimately a few of the key figures are not populating with current data and the company code is missing...unless I hit refresh on that query. I have tried creating new workbooks and removing and reinserting the queries, but this doesn't work either.
    And both queries run fine when executed alone.
    Again, Both queries use the same company code variable.
    Any help will be rewarded with points and is appreciated.

    Tasha,
    Remove the queries from the workbook and reinsert them. This should show the desired result.

  • How can I set a property when an event happens? (selection changed on datagrid)

    I have a datagrid, I would like to change the backgrund of the datagrid when the selection changed event is fired.
    I can not use data trigger, because is in the case that I expected a value, but in this case is when change, to any value.
    An option is to use an event trigger, but all the examples that I have found is to use with an actions, and I just want to set a property.
    How could I do that?
    I am using MVVM pattern, so I would like to avoid the use in code-behind.
    Thank so much.

    You could use an event trigger and implement your own TriggerAction<T> that sets the background property. There is an example of how to create a custom TriggerAction available here:
    http://stackoverflow.com/questions/942548/setting-a-property-with-an-eventtrigger.
    The following example sets the Background property of the DataGrid to a red SolidColorBrush when the SelectionChanged event is fired. It should give you the idea:
    <DataGrid x:Name="dgrid"
    xmlns:local="clr-namespace:WpfApplication22">
    <i:Interaction.Triggers>
    <i:EventTrigger EventName="SelectionChanged">
    <local:SetPropertyAction PropertyName="Background" TargetObject="{Binding ElementName=dgrid}">
    <local:SetPropertyAction.PropertyValue>
    <SolidColorBrush>Red</SolidColorBrush>
    </local:SetPropertyAction.PropertyValue>
    </local:SetPropertyAction>
    </i:EventTrigger>
    </i:Interaction.Triggers>
    <DataGrid.Columns>
    namespace WpfApplication22
    public class SetPropertyAction : TriggerAction<FrameworkElement>
    public string PropertyName
    get { return (string)GetValue(PropertyNameProperty); }
    set { SetValue(PropertyNameProperty, value); }
    public static readonly DependencyProperty PropertyNameProperty
    = DependencyProperty.Register("PropertyName", typeof(string),
    typeof(SetPropertyAction));
    public object PropertyValue
    get { return GetValue(PropertyValueProperty); }
    set { SetValue(PropertyValueProperty, value); }
    public static readonly DependencyProperty PropertyValueProperty
    = DependencyProperty.Register("PropertyValue", typeof(object),
    typeof(SetPropertyAction));
    public object TargetObject
    get { return GetValue(TargetObjectProperty); }
    set { SetValue(TargetObjectProperty, value); }
    public static readonly DependencyProperty TargetObjectProperty
    = DependencyProperty.Register("TargetObject", typeof(object),
    typeof(SetPropertyAction));
    protected override void Invoke(object parameter)
    object target = TargetObject ?? AssociatedObject;
    PropertyInfo propertyInfo = target.GetType().GetProperty(
    PropertyName,
    BindingFlags.Instance|BindingFlags.Public
    |BindingFlags.NonPublic|BindingFlags.InvokeMethod);
    propertyInfo.SetValue(target, PropertyValue);
    For more information about how to hook up event triggers and handle events in MVVM, please refer to my blog post:
    http://blog.magnusmontin.net/2013/06/30/handling-events-in-an-mvvm-wpf-application/
    Please also remember to mark helpful posts as answer.

  • How do I change the loop that is running when an event happens?

    Hello,
       I've written a program that does a linear temperature ramp on sample substrates under UHV. Right now, the program just ramps the current of a power supply(which heats the sample by radiative heating), reads the temperature from a thermocouple, and using a feedback formula adjust the current accordingly so that the ramp stays linear. All of this is done in a while loop.  I now need the program to be able to ramp to a certain temperature, and hold at that temperature for a time period.  I already have the feedback formula written in order to do this, but how do I tell my program to use my new loop once the old loop reaches a certain temperature? I was thinking maybe an event structure, but still not sure on how to use it.  Your help is greatly appreciated, thank you. 

    You need a state machine (or action engine). You can create one, from the Labview templates.
    see here
    An easier way is to stop the loop and continiou with a new loop. Of cource this option is "one way". 
    Attachments:
    Example_VI_BD.png ‏2 KB

  • How to stop an event action when other event happen ?

    This is my first swing program
    I want to design an application with two buttons,"start" and "stop"
    Pressing "start" will start listing data
    Pressing "stop" will stop listing data immediate
    What should I do??
    I try to use a flag like the following:
    ==============================
    btnStartActionPerformed() {
    while(1) {
    if (loop_break) break;
    btnStopActionPerformed() {
    loop_break = true;
    ==============================
    but btnStopActionPerformed() will not start until btnStartActionPerformed() is finished
    What should I do?

    I agree with the thread comment...
    But if you are going to use a while loop, you can do this:
    loop_break = false;
    while(!loop_break) {
    }But if you need to stop anywhere inside the loop, you need to use if statements to check that flag between every action the while loop contains. Otherwise, you're limited to breaking whenever you check the flag, of course, or as above, before the next loop iteration.

  • RMI Callback messages can not be sent to all clients

    we I send a message to all clients using RMI Callback the message dont arrive to all clients when one or more clients is disconnected without removing themselves from the hashtable at the server side .
    how i can know if the client is disconnected before sending the message to him using RMI callback taking into account that the client dosnt tell the server when he has disconnected.
    please i want a solution to this problem.
    thanks

    You seem to be making this a little complicated. During the login (or sometime) have one of the parms that are passed back to the server be a remote object on the client. It can have a nice interface like
    public void callMe(Object obj) throws .... or you could get cute and add
    pubic void shutDown() throws.... but this could be handled in the other method.
    During the call the client becomes the server and the server the client. The callMe method has no clue as to what thread it is on so it should just quickly queue up whatever it has gotten and return. It should not be doing work that will effect the Awt thread. If the client is no longer there then you should be able to catch this on the server, and continue posting other clients.
    Howie
    Your question is very similar to what I'm currently
    researching. I've got the additional complication of
    detecting when clients crash without unregistering (in
    my case unlocking) a resource. I haven't written any
    test code yet, so don't shoot me if I'm wrong, but
    here is my general strategy.
    In order to implementing RMI callbacks, it looks like
    you must make both the clients and the server register
    themselves in the RMI Registry. Parameters sent
    through RMI method calls are done by value so
    you can't simply add a listener as you normally do.
    The server will put itself in the registry using a
    well known ID. The clients will get this reference
    and ask the server for a unique ID. They will then
    register themselves in the RMI registry using this
    value. The client will then tell the server that it
    is registered. I believe if the client object is
    wrapped in a WeakReference, then when the client dies
    or ends, the reference contained in the WeakReference
    will be null. The server will perform this check on
    all registered clients to determine which clients are
    still alive.
    ,Marcus

  • Problem in sending username to all clients in a chat programme

    this is a repeat of the problem which i had posted earlier,due to ambiguous subject
    i wrote a server programme but i want to show to all the clients when they connect to the server , the name of the clients online, however when i am running the programme i don't get the names and the rest of the programme is working fine .... please can anyone help ....
    import java.io.*;
    import java.net.*;
    public class MultiThreadChatServer{
        // Declaration section:
        // declare a server socket and a client socket for the server
        // declare an input and an output stream
        static  Socket clientSocket = null;
        static  ServerSocket serverSocket = null;
        // This chat server can accept up to 10 clients' connections
        static  clientThread t[] = new clientThread[10];          
        public static void main(String args[]) {
         // The default port
         int port_number=2224;
         if (args.length < 1)
              System.out.println("Usage: java MultiThreadChatServer \n"+
                           "Now using port number="+port_number);
             } else {
              port_number=Integer.valueOf(args[0]).intValue();
         // Initialization section:
         // Try to open a server socket on port port_number (default 2222)
            try {
             serverSocket = new ServerSocket(port_number);
            catch (IOException e)
             {System.out.println(e);}
         // Create a socket object from the ServerSocket to listen and accept
         // connections.
         // Open input and output streams for this socket will be created in
         // client's thread since every client is served by the server in
         // an individual thread
         while(true){
             try {
              clientSocket = serverSocket.accept();
              for(int i=0; i<=9; i++){
                  if(t==null)
                   (t[i] = new clientThread(clientSocket,t)).start(); // creating that many instanceas for the class clientThread
                   break;
         catch (IOException e) {
              System.out.println(e);}
    // This client thread opens the input and the output streams for a particular client,
    // ask the client's name, informs all the clients currently connected to the
    // server about the fact that a new client has joined the chat room,
    // and as long as it receive data, echos that data back to all other clients.
    // When the client leaves the chat room this thread informs also all the
    // clients about that and terminates.
    class clientThread extends Thread{
    DataInputStream is = null;
    PrintStream os = null;
    Socket clientSocket = null;
    clientThread t[];
    public clientThread(Socket clientSocket, clientThread[] t){
         this.clientSocket=clientSocket;
    this.t=t;
    public void run()
         String line;
    String name;
         try{
         is = new DataInputStream(clientSocket.getInputStream());
         os = new PrintStream(clientSocket.getOutputStream());
         os.println("Enter your name.");
         name = is.readLine();
         os.println("Hello "+name+" to our chat room.\nTo leave enter /quit in a new line\n The present users online are:");
    for(int i=0; i<=9; i++)
              if (t[i]!=null && t[i]!=this)
              t[i].os.println(name);
    for(int i=0; i<=9; i++)
              if (t[i]!=null && t[i]!=this)
              t[i].os.println("*** A new user "+name+" entered the chat room !!! ***" );
         while (true) {
              line = is.readLine();
    if(line.startsWith("/quit")) break;
              //if(line.startsWith("PM:")
              //for(int j=0;j<=9;j++)
              //if(line.getcharsAt(3,))
              for(int i=0; i<=9; i++)
              if (t[i]!=null) t[i].os.println("<"+name+"> "+line);
         for(int i=0; i<=9; i++)
              if (t[i]!=null && t[i]!=this)
              t[i].os.println("*** The user "+name+" is leaving the chat room !!! ***" );
         os.println("*** Bye "+name+" ***");
         // Clean up:
         // Set to null the current thread variable such that other client could
         // be accepted by the server
         for(int i=0; i<=9; i++)
              if (t[i]==this) t[i]=null;
         // close the output stream
         // close the input stream
         // close the socket
         is.close();
         os.close();
         clientSocket.close();
         catch(IOException e){};
    Edited by: pranay09 on Oct 12, 2009 1:16 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    The "clientThread[] t" in the client code constructor is null. Initialize it .

  • Echo to all clients connected to NIO server

    I am writing a NIO xml socket server that uses NIO.
    My model implemensts a producer / consumer system where client connections are accepted and processed by a specified number of worker threads.
    I would like to be able to broadcast a message to all clients that are connected to the server.
    Opinions / suggestions I am sure that this is quite a common type of functionality.
    Kind Regards

    Accendia server is implementing a callback mechanism that allows the server to notify the client.
    This is not broadcast, you would have to call each client (www.accendia.com). For real broadcasting use datagram or multicast sockets (depends on different factors) on both client and server in addition to the sockets used as part of the NIO server.

  • Broadcast to all clients connected to NIO server

    I am writing a NIO xml socket server that uses NIO.
    My model implemensts a producer / consumer system where client connections are accepted and processed by a specified number of worker threads.
    I would like to be able to broadcast a message to all clients that are connected to the server.
    Opinions / suggestions I am sure that this is quite a common type of functionality.
    Kind Regards

    Accendia server allows the server side to invoke callback objects on the client. You can't do real broadcasting, though, you would have to iterate through all client connections. See if it helps:
    http://www.accendia.com
    If you need real broadcasting you can use datagram or multicast sockets on both the server and client side.

  • Excel 2013 not responding when doing refresh all for enbedded quires.

    System:
    Windows 8.1
    Intel I7 620 CPU
    12 GB ram
    Office 2013
    Issue 1:
    I have a excel file with 29 data from WEB quires. These are quires for stock data and the only difference in them is the ticker symbol. When I request a refresh all Excel goes into a not-responding mode and I have to quit the program to stop it. This same
    file ran OK in Excel 2010. I have the data on sheet one and about half the quires on sheet 2 and the remaining quires on sheet 3. Each quire downloads data a small table and cells in sheet one reference cells in sheet two and three. Two cells are accessed
    from each table. I had a Microsoft support person on the line today and she had me repair office, which didn't help. I removed Sheet 2 and Sheet 3 and redid all the quires and that didn't help. Each quire can be refreshed individually. 
    I also have a laptop with Office 2013 and Excel has the same problem with the same file.  
    Issue 2:
    Each row holds information about a given stock and gets current stock price and dividend percent from its quire table. The stock price comes from column A and the dividend percent come from column C two rows below the row the price is in. Every
    time a do a refresh the cell that references the data in Column C comes from two rows below the row it should come from. This does not happen for every stock only some of them. The reference to the data from the A column is always correct. This problem was
    happening in Excel 2010 too.

    Hi,
    To your first issue:
    Excel 2013 not responding may be caused by some reasons. Let's do some tests to narrow down the issue:
    Method 1: Verify/install the latest updates
    Method 2: Start Excel in safe mode
    Method 3: Investigate possible issues with add-ins
    Method 4: Check whether your antivirus software is up to date or is conflicting with Excel
    https://support.microsoft.com/kb/2758592/en-gb
    If the issue still exists, please upload the event log in the thread, I'll do more deeply
    research.
    To your second issue, would you like to upload a sample of the Excel file by using SkyDrive? I want to test in my PC.
    Regards,
    George Zhao
    TechNet Community Support

  • What event does FMS server fire when a clients starts/stops streaming

    I want to log activities on my stream (both live and recorded) using a web service I've made. In the FMS server side AS3 documentation I can find events for onconnect/ondisconnect, but that is not quite what I want. What I want is and event that fires when a user start viewing a stream, or stops viewing.  Today I'm using the following code:
    application.onConnect = function(client)
              client.getStreamLength = function( streamName ) {
                        LogStart('', this.id, this.ip, streamName);
                        return Stream.length( streamName );
       this.acceptConnection(client);
    However not all clients uses the getStreamLength, so this does not realy work. The problem is that in the "onConnect" even I do not have access to the streamname, else I think I could have used this event.
    Thanks in advance

    Hi Wujemurray,
    If you'd be so kind as to email me offlist we'll get a support incident opened for this and can get to the bottom of the issue you're facing.
    Asa
    [email protected]

  • Multiple select queries used in Excel BI report ,fetching data from Sharepoint DB(SP2010_Prod_ProjectServer) causing blockage on DB ,when more than one workbook(same copy of Excel BI Report) refreshed using Refresh All option.

    I am using mutiple select queries to fetch data from Project Server 2010 DB(its sharepoint DB) and these queries fetch data in Excel BI report by establishing connection with DB using instance name and all. I have enhance all these select queries and data
    is being fetched in secs. but when more than one copy of same Excel BI report is refreshed using 'Refresh All' option, then these select queries cause blockage on DB.
    Please let me know mitigation for this blockage issue.
    Should I use begin transaction and commit transaction statements/ shared lock statements.
    please reply

    Hi,
    run same query at the same time?

  • Help I just installed the latest update on my IPhone4 and now I can't open any of my stored podcasts. When I hit the podcast icon, the screen goes white for a second and the goes back to the opening page with all the icons. What happened?

    Help! I just installed the latest update on my IPhone 4 and now I can't access my podcasts. When I hit the podcast I on, the screen goes blank for a second and then opens to the home screen with all my icons. What happened?

    Try a reset which is similar to a computer restart and is done by pressing and holding the home button and the sleep/wake or on/off button simultaneously you see the Apple logo and then release.

Maybe you are looking for

  • 3 questions on visual changes and positioning

    Hello everyone, I hope I have the right section for my questions. (so many categories) I have three questions that I hope I can get answered. Question 1 ) I am writing an application that uses a JDesktopPane. I have a menu that each choice opens up a

  • Selecting data from external table

    Hi there I was wondering if somebody could assist me. When I try to select data from an external table, no data is displayed, and in my log file I receive the following error: KUP-04026: field too long for datatype. Please find attached my external t

  • URGENT -1 from DCM Command  on OBE deploy  === can not deploy/

    Attempting to complete the OBE "Deploying J2EE and ADF Applications http://www.oracle.com/technology/obe/obe9051jdev/deployToAppServer/lesson_Deployment.htm in order to prove to upper management that it is "easy" to develop on JDEV 9.0.5 build 1618 a

  • Blind cRIO project upgrade: 8.2.1 to 2011 problems

    Hello, I have been working on an old cRIO project of ours, a cRIO project originially written in 8.0, and targeted to a cRIO-9004 on a 9104 chassis.  It contains several network-published shared variables to talk to a host VI, so I was interesting in

  • WD Java , adaptive RFC beginnes question

    hi folks, i am  new to WD Java and have a very simple question. after getting data back from a RFC-Call to R/3 backend i call wdContext.nodeOutput().invalidate(); to have my result in the context node, but i never see the result in my context node af