Index: modules/http/src/main/java/com/sun/grizzly/http/deployer/Deployer.java
===================================================================
--- modules/http/src/main/java/com/sun/grizzly/http/deployer/Deployer.java	(revision 0)
+++ modules/http/src/main/java/com/sun/grizzly/http/deployer/Deployer.java	(revision 0)
@@ -0,0 +1,97 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License).  You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html or
+ * glassfish/bootstrap/legal/CDDLv1.0.txt.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at glassfish/bootstrap/legal/CDDLv1.0.txt.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ */
+package com.sun.grizzly.http.deployer;
+
+import com.sun.grizzly.http.embed.GrizzlyWebServer;
+import com.sun.grizzly.tcp.http11.GrizzlyAdapter;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.HashMap;
+
+/**
+ * Deployer abstraction.
+ *
+ * @author Hubert Iwaniuk
+ * @param <V> Type of object deployed by this deployer.
+ * @param <T> Type of deployer configuration.
+ * @since Sep 17, 2009
+ */
+public abstract class Deployer<V, T> {
+
+    private Map<Integer, Set<GrizzlyAdapter>> deployed = new HashMap<Integer, Set<GrizzlyAdapter>>();
+
+    /**
+     * Deploy deployable to gws.
+     *
+     * @param gws           Grizzly to deploy to.
+     * @param toDeploy      Deployable to be deployed.
+     * @param configuration Configuration of deployment.
+     *
+     * @return Deployment identification.
+     *
+     * @throws DeployException Error in deployment.
+     */
+    public final Integer deploy(GrizzlyWebServer gws, V toDeploy, T configuration)
+        throws DeployException {
+        Map<GrizzlyAdapter, Set<String>> map = convert(toDeploy, configuration);
+        if (map == null || map.isEmpty()) {
+            throw new DeployException("No GrizzlyAdapters created for: " + toDeploy);
+        }
+        for (Map.Entry<GrizzlyAdapter, Set<String>> adapterEntry : map.entrySet()) {
+            Set<String> mappings = adapterEntry.getValue();
+            gws.addGrizzlyAdapter(
+                adapterEntry.getKey(), mappings.toArray(new String[mappings.size()]));
+        }
+        final Integer deploymentId = toDeploy.hashCode();
+        deployed.put(deploymentId, map.keySet());
+        return deploymentId;
+    }
+
+    /**
+     * Undeploy previously deployed deployable. r
+     *
+     * @param gws          Grizzly to undeploy from.
+     * @param deploymentId Deployment identification
+     */
+    public final void undeploy(GrizzlyWebServer gws, Integer deploymentId) {
+        final Set<GrizzlyAdapter> adapters = deployed.get(deploymentId);
+        for (GrizzlyAdapter adapter : adapters) {
+            gws.removeGrizzlyAdapter(adapter); // TODO removal can go wrong
+        }
+    }
+
+    /**
+     * Converts deployable object to {@link Map} of {@link GrizzlyAdapter}s to paths to deploy to.
+     *
+     * @param toDeploy      Deployable object to be converted.
+     * @param configuration Configuration of deployment.
+     *
+     * @return {@link Map}ping {@link GrizzlyAdapter}s to paths to be deployed under ({@link Set} of
+     *         {@link String}s).
+     *
+     * @throws DeployException Error while creating adapters.
+     */
+    protected abstract Map<GrizzlyAdapter, Set<String>> convert(V toDeploy, T configuration)
+        throws DeployException;
+}
Index: modules/http/src/main/java/com/sun/grizzly/http/deployer/FromURIDeployer.java
===================================================================
--- modules/http/src/main/java/com/sun/grizzly/http/deployer/FromURIDeployer.java	(revision 0)
+++ modules/http/src/main/java/com/sun/grizzly/http/deployer/FromURIDeployer.java	(revision 0)
@@ -0,0 +1,63 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License).  You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html or
+ * glassfish/bootstrap/legal/CDDLv1.0.txt.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at glassfish/bootstrap/legal/CDDLv1.0.txt.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ */
+package com.sun.grizzly.http.deployer;
+
+import com.sun.grizzly.http.embed.GrizzlyWebServer;
+
+import java.net.URI;
+
+/**
+ * Deployer abstraction supporting deployment from {@link URI} .
+ *
+ * @author Hubert Iwaniuk
+ * @param <V> Type of object deployed by this deployer.
+ * @param <T> Type of deployer configuration.
+ * @since Sep 18, 2009
+ */
+public abstract class FromURIDeployer<V, T> extends Deployer<V, T> {
+
+    /**
+     * Deploy deployable to gws.
+     *
+     * @param gws           Grizzly to deploy to.
+     * @param deployFrom    URI ofr deployable to be deployed.
+     * @param configuration Configuration of deployment.
+     *r
+     * @return Deployment identification.
+     *
+     * @throws DeployException Error in deployment.
+     */
+    public final Integer deploy(GrizzlyWebServer gws, URI deployFrom, T configuration)
+        throws DeployException {
+        return super.deploy(gws, fromURI(deployFrom), configuration);
+    }
+
+    /**
+     * Create object to deploy from uri.
+     *
+     * @param uri of deployable object.
+     *
+     * @return Deployable object.
+     */
+    public abstract V fromURI(URI uri);
+}
Index: modules/http/src/main/java/com/sun/grizzly/http/deployer/DeployException.java
===================================================================
--- modules/http/src/main/java/com/sun/grizzly/http/deployer/DeployException.java	(revision 0)
+++ modules/http/src/main/java/com/sun/grizzly/http/deployer/DeployException.java	(revision 0)
@@ -0,0 +1,51 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License).  You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html or
+ * glassfish/bootstrap/legal/CDDLv1.0.txt.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at glassfish/bootstrap/legal/CDDLv1.0.txt.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ */
+package com.sun.grizzly.http.deployer;
+
+/**
+ * Deploying error.
+ *
+ * @author Hubert Iwaniuk
+ * @since Sep 17, 2009
+ */
+public class DeployException extends Exception {
+    /** {@inheritDoc} */
+    public DeployException() {
+        super();
+    }
+
+    /** {@inheritDoc} */
+    public DeployException(String message) {
+        super(message);
+    }
+
+    /** {@inheritDoc} */
+    public DeployException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    /** {@inheritDoc} */
+    public DeployException(Throwable cause) {
+        super(cause);
+    }
+}
Index: modules/http/src/main/java/com/sun/grizzly/http/embed/GrizzlyWebServer.java
===================================================================
--- modules/http/src/main/java/com/sun/grizzly/http/embed/GrizzlyWebServer.java	(revision 3649)
+++ modules/http/src/main/java/com/sun/grizzly/http/embed/GrizzlyWebServer.java	(working copy)
@@ -24,11 +24,14 @@
 package com.sun.grizzly.http.embed;
 
 import com.sun.grizzly.SSLConfig;
-import com.sun.grizzly.arp.DefaultAsyncHandler;
 import com.sun.grizzly.arp.AsyncFilter;
 import com.sun.grizzly.arp.AsyncHandler;
+import com.sun.grizzly.arp.DefaultAsyncHandler;
 import com.sun.grizzly.http.Management;
 import com.sun.grizzly.http.SelectorThread;
+import com.sun.grizzly.http.deployer.DeployException;
+import com.sun.grizzly.http.deployer.Deployer;
+import com.sun.grizzly.http.deployer.FromURIDeployer;
 import com.sun.grizzly.ssl.SSLSelectorThread;
 import com.sun.grizzly.tcp.Adapter;
 import com.sun.grizzly.tcp.http11.GrizzlyAdapter;
@@ -38,14 +41,16 @@
 import com.sun.grizzly.tcp.http11.GrizzlyResponse;
 import com.sun.grizzly.util.ClassLoaderUtil;
 import com.sun.grizzly.util.net.jsse.JSSEImplementation;
+
+import javax.management.ObjectInstance;
+import javax.management.ObjectName;
 import java.io.IOException;
+import java.net.URI;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Map.Entry;
 import java.util.logging.Level;
 import java.util.logging.Logger;
-import javax.management.ObjectInstance;
-import javax.management.ObjectName;
 
 
 /**
@@ -741,4 +746,52 @@
             return adapterChains;
         }
     }
+
+    /**
+     * Deploy given deployable using provided deployer.
+     *
+     * @param toDeploy      Deplyable to deploy.
+     * @param deployer      to be used for deployment.
+     * @param configuration Deployment configuration.
+     * @param <T>           Type of object to be deployed.
+     * @param <V>           Deployment configuration type.
+     *
+     * @return Deployment identification.
+     *
+     * @throws DeployException Deployment failed.
+     */
+    public <T, V> Integer deploy(T toDeploy, Deployer<T, V> deployer, V configuration)
+        throws DeployException {
+        return deployer.deploy(this, toDeploy, configuration);
+    }
+
+    /**
+     * Deploy from given uri using provided deployer.
+     *
+     * @param fromURI       uri to deploy from.
+     * @param deployer      to be used for deployment.
+     * @param configuration Deployment configuration.
+     * @param <T>           Type of object to be deployed.
+     * @param <V>           Deployment configuration type.
+     *
+     * @return Deployment identification.
+     *
+     * @throws DeployException Deployment failed.
+     */
+    public <T, V> Integer deploy(URI fromURI, FromURIDeployer<T, V> deployer, V configuration)
+        throws DeployException {
+        return deployer.deploy(this, fromURI, configuration);
+    }
+
+    /**
+     * Undeploy deploymentId using provided deployer.
+     *
+     * @param deploymentId Deployment identification to be undeployed.
+     * @param deployer     to be used for undeploing.
+     * @param <T>          Type of object to be deployed.
+     * @param <V>          Deployment configuration type.
+     */
+    public <T, V> void undeploy(Integer deploymentId, Deployer<T, V> deployer) {
+        deployer.undeploy(this, deploymentId);
+    }
 }