All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.googlecode.gwtrpcplus.server.internal.SimpleGwtRpcPlusContext Maven / Gradle / Ivy

The newest version!
package com.googlecode.gwtrpcplus.server.internal;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.googlecode.gwtrpcplus.server.GwtRpcPlusContext;

public class SimpleGwtRpcPlusContext implements GwtRpcPlusContext {

  private final HashSet servlets = new HashSet<>();

  @Override
  public void register(Class servlet) {
    try {
      register(servlet.newInstance());
    } catch (InstantiationException | IllegalAccessException e) {
      throw new IllegalStateException(e);
    }
  }

  @Override
  public void register(RemoteServiceServlet servlet) {
    servlets.add(servlet);
  }

  
  @Override
  public Set getServlets() {
    return Collections.unmodifiableSet(servlets);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy