The Elvis Java class library


Elvis is a Java class library that can be included in applications to ensure that, on a particular workstation system, for a particular user, there is only one instance of that application running.

This single application is referred to as the One True Elvis; other instances of the same application are Elvis Clients, aka Elvis Impersonators. If there are multiple users on a machine (for example, on a Linux or Solaris system), or if a user has invoked multiple different applications, there may be multiple One True Elvis's on a system. However, for a given application, there will never be more than a single One True Elvis of that application for a given user.

The concept of Elvis is inspired by the Jext project's org.jext.JextLoader class, but provides more general and secure implementation.

Using Elvis

Elvis is intended for use when you want only one instance of an application to exist for a given user.

It's expected that Elvis clients will simply pass the One True Elvis their command line arguments (and possibly other information) for processing, and then exit.

The model of behavior for the One True Elvis is this:

  1. Application initializes and sets up Elvis;
  2. Elvis looks for another Elvis implementing the same application for the same user on the system;
  3. Finding none, Elvis registers himself as the One True Elvis;
  4. Elvis creates the listener thread, and returns to the application;
  5. the listener waits for requests from Elvis clients;
  6. the listener processes requests as they are received.

The model of client interaction for Elvis is this:

  1. Elvis client initializes and sets up Elvis;
  2. Elvis looks for another Elvis implementing the same application for the same user on the system;
  3. finding one, the Elvis returns control to the application;
  4. the application, determining that Elvis is not the One True Elvis, asks its Elvis Impersonator to pass its commandline information to the One True Elvis;
  5. the client exits.

For more information about how to use Elvis, see the (not yet written) Elvis How-To, and the (not yet available) Elvis Javadoc.

What Elvis is not

Elvis is not a program you can run. Instead, Java developers can include Elvis in their application to ensure that only a single instance of the application exists for a given user on a given machine.

Elvis is not intended for session/connection based interprocess communications, or for persistent clients. Elvis isn't a replacement for RMI, Corba, System V IPC, sockets, or other traditional and more general methods of extended interprocess communications.

Features of Elvis

Security Elvis only accepts connections from the local host. Connections originating from other hosts are logged and rejected. If too many such connections are received, Elvis will exit on the assumption that this is a exploit attempt.
Uniqueness Elvis works regardless of the number of JVMs that may be running for a given user, or the number of users on the machine. Not yet completely implemented.


SourceForge Logo Hosting and related project support for Elvis is provided by SourceForge.
[Synaptics Logo] Elvis originates at Synaptics, Inc.

Last updated May 2, 2002 by Christopher Heiny