Communicate between two (same) Applications

Hi there,
I've written a server application in java.
This Server is always running in the background.
For restart/shutdown or similar purpose I want to communicate with this application.
Is ist possible to start the same application with a args-flag that causes the running server to shutdown.
I know it's easy possible by doing this via the socket connection.
Because of security-reasons I want to avoid this. To limit this to the localhost is to insecure.
Any ideas?

Ok, I will explain it in detail.
I don't want to open a new Port for this,
so it is possible to use the existing open port.
The idea to limit control sequences to localhost can made by Socket.getInetAdress() (maybe insecure (fake IP)) for the existing port or via Konstruktor of ServerSocket for a new port
The point is:
I dont't want to grant access to other users on this machine!
And I don't want to limit a port for localhost from the system-enviroment via root-possibilities.
If there is no other possibility, I think I try to use a new Port for this. I just wanted to know if this is the only possibility or are there other easier ways.
Thanx for helping
thosta

Similar Messages

  • How to communicate between two servlet applications.

    I want to write a program that the system manager can see who is connecting the server.
    the system manager login the server via the browser with applet.
    the applet communicate with servlet .and the servlet work in the server get the customer message such as username ,Ip address etc from other servlet.
    how to realize it .?
    can you give some advice .
    I appreciate you .
    thank you

    Look at, http://forum.java.sun.com/thread.jsp?forum=54&thread=262144

  • Communicate between two iviews

    Hi everyone, if i create two iviews. And i want to pass a variable from one iview to the other one by triggling an event .
    What technology can help me do that?  Thx~~

    Hi Louis,
        Communication between two iviews is accomplished by EPCF concept.
      Refer to this forum thread where Prakash Singh has clearly explained about the same
    Communicate between two iviews
    Hope this helps.
    Regards,
    Joshua Kiran

  • How can I communicate between two simulated software

    Hallo,
    I have confusion regarding this topic "How can I communicate between two simulated software".
    1: PC with CAN simulation
    2:  PC with AFDX Simulation
    Now i have to communicated these two pc with each other.
    How can i communicated? which module from ni is best for it.
    thanks in advance
    BR

    I recommend looking at the Simple Messaging Reference Library that NI has released.  Use the TCP/IP version of it.
    FYI, TCP/IP is a communication protocol that is used to communicate between two computers.  It is what the internet uses.  So you just need a network switch or router between your computers and you can talk to each other with their IP address.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Communicate between two desktops

    Can anyone lead me to a resource, or briefly describe the process, to address the scenerio below:
    I have two Windows computers on a LAN. I need to develop an application  for each computer that (when both computers are runing the application) allows communication between the two machines. For example: pressing a button within the application on one computer would execute a function in the application of the other computer). I am comfortable building stand-alone air apps and web-based PHP/MySQL apps with Flash/Air/Dreamweaver; however, I don't know where to start when creating a connection between two computers. Any suggestions? Thanks!

    I've worked on several projects where we did this. We used a "client/server" architecture where one of the AIR apps acts as the "server" (conceptually it's the same as a web server) and the other AIR app is the "client" that connects to the server the way a web browser would talk to a web server.
    For your "client" use the Socket class.
    For your "server" use the ServerSocket class.
    Alternatively, we also used UDP sometimes, so we'd use the DatagramSocket class on both sides (both act as "sender/receiver"). However, my recollection is that we ended up moving away from UDP since it's unreliable (by design) and switched to using TCP sockets (Socket/ServerSocket).

  • How change information between two Web Applications?

    Hi,
    Has anyone any code sample or article how to build
    a "bridge" that would change data stored into session and servletcontext
    between two separete web application in same servlet engine?
    What I have understood is that they can not normally share same
    session or servletcontext data...
    Thanks,

    Hmm...
    Text in this Sun's tutorial says:
    "This lesson, however, shows you what to do if your servlet requires a resource available from its own server"
    The actual problem is following:
    - In Web Application 1 servlets/jsps stores data into session object and servletcontext
    - then user can request a page in Web Application 1 which should "activate/launch" Web Appilication 2 and
    pass some session objects or objects stored into servletcontext from Web Application 1 to Web Application 2.
    How to do this, it's the problem.

  • Drag between two flex applications?

    Hi,
    In the project I'm working on I display tree which the user can manipulate by dragging and dropping. So far I have a tree in a flex application, and I've implemented dragging and dropping. I'd like the user to be able to drag from one tree to another, but as my flex application will interact with my HTML pages, I don't want to waste space by having room for the second tree all the time.
    The flex application is embedded on a HTML page, and I'd like to be able to have two instances of my flex application and have the user able to drag between them. Is this possible? I did wonder if it would be possible to implement something like this using a javascript callback, but is there a standard way of doing this?
    Thanks,
    Jonny

    Hi Jonny,
    I've also faced with problem of draging between two applications.
    It's possible to transmit data between these applications, but it's only a half of the task.
    The main problem it to handle mouse release error on second application.
    There is no problem to handle that user drag object and move it out of the component - it's ok.
    After that we should handle the position of droping this object.
    Also it's no problem to handle that mouse is on over component and left button is pushed (at this handle create imitation of starting draging). But it's impossible to handle first mouseUp event. This event don't visible in html (object don't rise mouseUp event) and don't handle in flex. I'm still try to understand the way to get round.
    The only way I've founded is to hide flash object on mouseOver event and show an image instead of it until mouseUp event raised. After that show flash and calculate the position of draging. But's if you use tree it's not a good way.

  • Drag and Drop between two java applications

    Hi,
    I am trying to implement drag and drop between two instances of our java application. When i drop the content on the target, the data flavors are transmitted properly, but i get the exception :
    java.awt.dnd.InvalidDnDOperationException: No drop current
         at sun.awt.dnd.SunDropTargetContextPeer.getTransferData(SunDropTargetContextPeer.java:201)
         at sun.awt.datatransfer.TransferableProxy.getTransferData(TransferableProxy.java:45)
         at java.awt.dnd.DropTargetContext$TransferableProxy.getTransferData(DropTargetContext.java:359)
         at com.ditechcom.consulbeans.TDNDTree.drop(TDNDTree.java:163)
         at java.awt.dnd.DropTarget.drop(DropTarget.java:404)
         at sun.awt.dnd.SunDropTargetContextPeer.processDropMessage(SunDropTargetContextPeer.java:547)
    How can i fix this ?
    Thanks a lot,
    Karthik

    Play with this;-import java.awt.*;
    import java.awt.datatransfer.*;
    import java.awt.dnd.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    // Credit to bbritna who I stole it from in the 'New To ..' Forum
    public class DragComps implements DragGestureListener, DragSourceListener,
                                         DropTargetListener, Transferable{
        static final DataFlavor[] supportedFlavors = { null };
        static{
              try {
                  supportedFlavors[0] = new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType);
              catch (Exception ex) { ex.printStackTrace(); }
        Object object;
        // Transferable methods.
        public Object getTransferData(DataFlavor flavor) {
               if (flavor.isMimeTypeEqual(DataFlavor.javaJVMLocalObjectMimeType))
             return object;
               else return null;
        public DataFlavor[] getTransferDataFlavors() {
               return supportedFlavors;
        public boolean isDataFlavorSupported(DataFlavor flavor) {
               return flavor.isMimeTypeEqual(DataFlavor.javaJVMLocalObjectMimeType);
        // DragGestureListener method.
        public void dragGestureRecognized(DragGestureEvent ev)    {
               ev.startDrag(null, this, this);
        // DragSourceListener methods.
        public void dragDropEnd(DragSourceDropEvent ev) { }
        public void dragEnter(DragSourceDragEvent ev)   { }
        public void dragExit(DragSourceEvent ev)        { }
        public void dragOver(DragSourceDragEvent ev) {
               object = ev.getSource(); }
        public void dropActionChanged(DragSourceDragEvent ev) { }
        // DropTargetListener methods.
        public void dragEnter(DropTargetDragEvent ev) { }
        public void dragExit(DropTargetEvent ev)      { }
        public void dragOver(DropTargetDragEvent ev)  {
               dropTargetDrag(ev); }
        public void dropActionChanged(DropTargetDragEvent ev) {
           dropTargetDrag(ev); }
        void dropTargetDrag(DropTargetDragEvent ev) {
               ev.acceptDrag(ev.getDropAction()); }
        public void drop(DropTargetDropEvent ev)    {
               ev.acceptDrop(ev.getDropAction());
                   try {
                       Object target = ev.getSource();
                      Object source = ev.getTransferable().getTransferData(supportedFlavors[0]);
                       Component component = ((DragSourceContext) source).getComponent();
                       Container oldContainer = component.getParent();
                       Container container = (Container) ((DropTarget) target).getComponent();
                       container.add(component);
                       oldContainer.validate();
                       oldContainer.repaint();
                       container.validate();
                       container.repaint();
                   catch (Exception ex) { ex.printStackTrace(); }
                   ev.dropComplete(true);
        public static void main(String[] arg)    {
              JButton button = new JButton("Drag this button");
              JLabel label = new JLabel("Drag this label");
              JCheckBox checkbox = new JCheckBox("Drag this check box");
              JFrame source = new JFrame("Source Frame");
              Container source_content = source.getContentPane();
              source.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              source_content.setLayout(new FlowLayout());
              source_content.add(button);
              source_content.add(label);
              JFrame target = new JFrame("Target Frame");
              Container target_content = target.getContentPane();
              target.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              target_content.setLayout(new FlowLayout());
              target_content.add(checkbox);
              DragComps dndListener = new DragComps();
              DragSource dragSource = new DragSource();
              DropTarget dropTarget1 = new DropTarget(source_content,
              DnDConstants.ACTION_MOVE, dndListener);
              DropTarget dropTarget2 = new DropTarget(target_content,
              DnDConstants.ACTION_MOVE, dndListener);
              DragGestureRecognizer dragRecognizer1 =
              dragSource.createDefaultDragGestureRecognizer(button,
              DnDConstants.ACTION_MOVE, dndListener);
              DragGestureRecognizer dragRecognizer2 =
              dragSource.createDefaultDragGestureRecognizer(label,
              DnDConstants.ACTION_MOVE, dndListener);
              DragGestureRecognizer dragRecognizer3 =
              dragSource.createDefaultDragGestureRecognizer(checkbox,
              DnDConstants.ACTION_MOVE, dndListener);
              source.setBounds(0, 200, 200, 200);
              target.setBounds(220, 200, 200, 200);
              source.show();
              target.show();
    }[/code                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Navigation between two webdynpro applications

    Hi Colleagues,
    Please let me know some workaround for the below requirement
    here i have two webdynpro application, where i have to call the second application from a button of first application by passing a parameter
    please let me know hoe to proceed here
    i have some information attached below....Is it the right way to do it? or am i missing somethinng here
    String deployableObjectName =  wdComponentAPI.getDeployableObjectPart().getDeployableObjectName();
      Map urlParameters = new HashMap();
      try {
          urlParameters.put("A",CVNR);
    WDDeployableObjectPart deployableObjectPart =WDDeployableObject.getDeployableObjectPart(
    "a1s~cc~checkprerequisites","Preq",WDDeployableObjectPartType.APPLICATION);
    String urlToTargetApp =WDURLGenerator.getApplicationURL(deployableObjectPart, urlParameters);
      IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(urlToTargetApp);
    window.show();
    catch (WDURLException e) {
                wdComponentAPI.getMessageManager().reportException(e.getLocalizedMessage(), false);
                } catch (WDDeploymentException ex) {
                     wdComponentAPI.getMessageManager().reportException(ex.getLocalizedMessage(), false);
    Thanks & Regards
    Swetha

    Hi Swetha,
    Please try this code in the application which is now launched from the 1st application. You can write this code in the wdDoinit() method OR the firstTime loop of the wdDoModify function:
    String applicationParam = WDWebContextAdapter.getWebContextAdapter().getRequestParameter("A");
    Here "A" is the name of the attribute in which you are setting the parameter value CVNR.
    You will get the URL parameter you have passed to this application from the first application. I hope this solves your problem, if yu have any issues please contact back.
    Thanks and Regards,
    Pravesh

  • Communicate between two differente JavaFX desktop design file

    I have created two JavaFX desktop design file with netbeans 6.9.1. One is the login and the other de principal menu. In java i create a object of the principal menu an just call object.setVisible(true).
    So in javafx how to call the menu principal from the login?. what should i code in the btnLoginAction??
    this is the login javafx:
    function btnLoginAction(): Void {
    function run (): Void {
    var design = Login {};
    Stage {
    title: "Main"
    scene: design.getDesignScene ()
    }

    I'm not looking for a "tutorial created especially for me".... Just perhaps someone that can copy and paste some code from a similar project that they have done so I understand how to do it.
    You could have simply put here's a tutorial for how to use TweenLite to crossfade between four pages, and here's one that will let you pass information between two .swf files. If you recently watched the tutorials then it wouldn't take long to find them (maybe you have them bookmarked) and post a couple links.
    Anyways, I just found an excellent tutorial on how to crossfade using TweenLite (found here) and an article that explains how to pass information from one .swf to another (here). It took some searching and knowing exactly what I was looking for to find them, but that's a much better answer for someone looking to do those two things than I've found here (or elsewhere for that matter).

  • Communicate between two backing beans

    Hi !
    How can I communicate between backing beens ?
    I would like to put data from Bean1 to Bean2.
    This is my code in Bean1, I try this:
    Bean2 b = new Bean2();
    //... b settings...
    //Map map = facesContext.getExternalContext().getRequestMap();
    //map.put("Bean2", b);
    HttpServletRequest request = (HttpServletRequest)facesContext.getExternalContext().getRequest();
    request.setAttribute("Bean2", b);
    So I put Bean2 instance in request, but JSF created new instance :(
    How can I solve this problem ?

    This article might give you some new insights: http://balusc.xs4all.nl/srv/dev-jep-com.html

  • Communication between two web applications deployed on same app server

    I need to update the war file of one application(say Application A) from another application(say application B). Actually application B is the admin application of application A.
    In order to achieve this, I need to get the ServletContext of A from B. How can I do that?
    P.S: Both the applications will be deployed on the same app server and they are app server independent.

    from the JavaDocs:
    http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletContext.html
    getContext
    public ServletContext getContext(java.lang.String uripath)
    Returns a ServletContext object that corresponds to a specified URL on the server.
    This method allows servlets to gain access to the context for various parts of the server, and as needed obtain RequestDispatcher objects from the context. The given path must be begin with "/", is interpreted relative to the server's document root and is matched against the context roots of other web applications hosted on this container.
    In a security conscious environment, the servlet container may return null for a given URL.
    Parameters:
    uripath - a String specifying the context path of another web application in the container.
    Returns:
    the ServletContext object that corresponds to the named URL, or null if either none exists or the container wishes to restrict this access.
    See Also:
    RequestDispatcher

  • Interaction between two web applications

    Hi All,
    I have an issue regarding 2 web projects.
    I have
    web application-----------related context path
    project1 ----------path1
    project2 ------------path2
    Scenario:
    Step1)
    I have logged in project1 with the foll url:
    http://localhost:8080/path1/index.jsp
    Step2);
    In index.jsp i have a button to navigate to
    http://localhost:8080/path2/page1.jsp
    Issue:
    Here is the issue.I have set one session attribute set in step1 and i need to acces it in step2.Im getting the attribute as null in step2.
    Can any one please let me know wht and where the issue is and the solution for it.
    Please help me out.
    Thanks in advance
    cheers,
    Shorath

    The fundamental problem is that web apps basically have no knowledge of each other. So if you're deploying to seperate WAR files, they're pretty much independent of each other and, specifically, can not share session data at all.
    If you want to share data between webapps, you need to use something outside the container (like a database), or you can play games with class loaders, and static class elements, making sure that your common classes are loaded outside of the webapps themselves.
    For example, in Tomcat, the shared and common directories hold classes that are loaded by the container directly and presented to your webapps.
    If you have a class with static members loaded from the common or shared directory, then both webapps will see the same instances of that class, and can share information that way. However, these classes will not be reloaded if you reload the webapps, only if you restart the container.
    The other problem, of course, is that these classes are agnostic of the session, so you'll need to implement your own session management if the data is unique to the users of your application. Kind of a catch-22.

  • To communicate between two process

    I have two processes running on two different machines. They have to communicate with each other by sharing messages in a peer to peer manner. What is the best possible way to achieve this. I have finalised upon using sockets, but reestablishing connections after other peer is brought down is a pain with sockets.
    thanks and regards.

    To exactly put it there's a GUI running on one machine and a process on other. both of these share messages. Now it must be something like bringing one down then other should not be affected it should keep buffering messages and wait for other side to come up and then start sending messages. I looked into JXTA it seemed to be a big API to work with for such a small applicaiton. It won't be a good idea to provide client with hardly some 500K of class file(or less probably) and 1.4 MB of API's. So thats why thought of writing my own communication classes which will handle this on both ends. How complicated JMS would be to work with. Does it have direct calls like register an application on some machine and then start sending and recieving messages and also take care of any of these processes being up or down.
    let me know
    thanks a ton for your support.

  • Communicate between two JInternalFrames

    Hello all.
    I have a swing application where I have a JFrame that encompasses two JInternalFrame's.
    We'll call them AppFrame, IFrame and StatusFrame
    I am attempting to create a running log of messages (Strings) that will be shown in StatusFrame.
    The IFrame will be generating these messages that need to show up on StatusFrame.
    Both are invoked by AppFrame.
    My question is: How do I pass the message from IFrame to StatusFrame? I imagine it will involve some object sharing, but my brain is fried.
    If anyone could point me in the right direction, I would appreciate it.
    Thanks!

    Thanks for bringing me up to speed!
    Just a couple of questions...please forgive me, I am very new to homegrowing listeners.
    1) When you said "which should save off the listener in some collection", how would you go about taking StatusListener listener and storing it, and, how do I access it to send a status? Do I access it by using:
    listener.statusChanged("message")?
    2) When you say "use the addStatusListener method of the iframe to add itself", just for clarification, I assume you mean something to the effect of:
    iframe.addStatusListener(statusFrame) , right?
    Again, thank you for helping me understand. I'm not quite there, but I am a lot further than I was yesterday.
    Message was edited by:
    nawlej

Maybe you are looking for

  • CANNOT install Adobe AIR, administrator error. could not update past .20 version

    consistently receive following message: an error occurred while installing Adobe AIR. Installation may not be allowed by your administrator. Please contact your administrator. I receive this message AS AN ADMINISTRATOR (only user on Netbook IS me, TH

  • Restore from Time Capsule fails

    I'm trying to restore from my Time Capsule backup over ethernet. I've tried with two different cat5e cables, but each time it goes extremely slowly, (it only gets to .4% after an hour and says it'll take 600 hours). After about an hour it fails and t

  • Indesign cs6 menu and tool bar disappear between windows using mission control in mountain lion

    heres 2  screen grabs before and after. while navigating between 'spaces' using mission control in mountain lion. issue -  the menu and tools bars disappear - not all of them just parts of them. to get back i hit 'tab' button twice which hides and sh

  • Convert VRO video files to Quicktime?

    I want to edit and convert files I recorded on my panasonic dvd recorder on my iMac. I have quicktime 7Pro, Quicktime 10 Player, Toast 10 Titanium, Handbrake, and Streamclip. I cannot seem to get the correct combination of steps to convert files to Q

  • Opening Multiple Tabs Crashes Safari.. Everytime..

    Opening Multiple Tabs Crashes Safari.. Everytime.. here is the crash report. Any help is greatly appreciated.. If I want to completely reinstall Safari fresh, how do I do that? Can I just delete it and reinstall it? TIA Process: Safari [2195] Path: /