Android Open Source - Gents Null Server






From Project

Back to project page Gents.

License

The source code is released under:

MIT License

If you think the Android project Gents listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.gsfraley.gents.service.servers.nullserver;
/*  www.  j  av a 2s. c o  m*/
import org.gsfraley.gents.service.ServerGhost;

import android.content.Context;
import android.content.Intent;

public class NullServer extends ServerGhost {
  public final static String NAME = "NullServer";
  public final static String DESCRIPTION = "A server that does nothing!";
  
  // Not configurable!
  public boolean isConfigurable() { return false; }
  
  public String getName() {
    return NAME + ":" + Integer.toString(getServerId());
  }
  
  public String getDescription() {
    return DESCRIPTION;
  }
  
  public NullServer(Context context, int sid) {
    super(context, sid);
    System.out.println(getName() + " created!");
  }
  
  @Override
  public void start() {
    if(status == RUNNING) {
      System.out.println(getName() + " already started!");
      return;
    }
    
    status = RUNNING;
    System.out.println(getName() + " started!");
  }

  @Override
  public void stop() {
    if(status == STOPPED) {
      System.out.println(getName() + " already stopped!");
      return;
    }
    
    status = STOPPED;
    System.out.println(getName() + " stopped!");
  }

  @Override
  public Intent configIntent() {
    return null;
  }
}




Java Source Code List

fi.iki.elonen.NanoHTTPD.java
org.gsfraley.gents.app.adapters.RunningServerAdapter.java
org.gsfraley.gents.app.adapters.ServerTypeAdapter.java
org.gsfraley.gents.app.fragments.RunningServerFragment.java
org.gsfraley.gents.app.fragments.ServerTypeFragment.java
org.gsfraley.gents.app.main.MainActivityListener.java
org.gsfraley.gents.app.main.MainActivity.java
org.gsfraley.gents.service.ManagerListener.java
org.gsfraley.gents.service.ServerBoss.java
org.gsfraley.gents.service.ServerGhost.java
org.gsfraley.gents.service.ServerManager.java
org.gsfraley.gents.service.servers.echoserver.EchoServerPreferenceActivity.java
org.gsfraley.gents.service.servers.echoserver.EchoServer.java
org.gsfraley.gents.service.servers.helloserver.HelloServerPreferenceActivity.java
org.gsfraley.gents.service.servers.helloserver.HelloServer.java
org.gsfraley.gents.service.servers.nullserver.NullServer.java
org.gsfraley.gents.service.servers.yesserver.YesServerPreferenceActivity.java
org.gsfraley.gents.service.servers.yesserver.YesServer.java