diff --git a/jrebel/pom.xml b/jrebel/pom.xml deleted file mode 100644 index 434e3e92e..000000000 --- a/jrebel/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - 4.0.0 - - org.kohsuke.stapler - stapler-parent - ${changelist} - - - stapler-jrebel - Stapler JRebel module - JRebel reloading support for Stapler - - - - ${project.groupId} - stapler - ${project.version} - - - org.kohsuke.metainf-services - metainf-services - true - - - jakarta.servlet - jakarta.servlet-api - 5.0.0 - provided - - - org.zeroturnaround - jr-sdk - 2.1.1 - provided - - - - diff --git a/jrebel/src/main/java/org/kohsuke/stapler/JRebelFacet.java b/jrebel/src/main/java/org/kohsuke/stapler/JRebelFacet.java deleted file mode 100644 index 6bcc5f158..000000000 --- a/jrebel/src/main/java/org/kohsuke/stapler/JRebelFacet.java +++ /dev/null @@ -1,89 +0,0 @@ -package org.kohsuke.stapler; - -import jakarta.servlet.RequestDispatcher; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.kohsuke.MetaInfServices; -import org.kohsuke.stapler.export.ModelBuilder; -import org.kohsuke.stapler.lang.Klass; -import org.zeroturnaround.javarebel.ClassEventListener; -import org.zeroturnaround.javarebel.ReloaderFactory; - -/** - * Adds JRebel reloading support. - * - * @author Kohsuke Kawaguchi - */ -@MetaInfServices -public class JRebelFacet extends Facet { - // Not obviously convertible to ClassValue. - private Map metaClasses; - - public class ReloaderHook implements Runnable { - @Override - public void run() { - ReloaderFactory.getInstance().addClassReloadListener(new ClassEventListener() { - @Override - public void onClassEvent(int eventType, Class klass) { - synchronized (metaClasses) { - for (Entry e : metaClasses.entrySet()) { - if (klass.isAssignableFrom(e.getKey())) { - LOGGER.fine("Reloaded Stapler MetaClass for " + e.getKey()); - e.getValue().buildDispatchers(); - } - } - } - // purge the model builder cache - ResponseImpl.MODEL_BUILDER = new ModelBuilder(); - } - - @Override - public int priority() { - return PRIORITY_DEFAULT; - } - }); - metaClasses = new HashMap<>(); - } - } - - public JRebelFacet() { - try { - Runnable r = (Runnable) Class.forName(JRebelFacet.class.getName() + "$ReloaderHook") - .getConstructor(JRebelFacet.class) - .newInstance(this); - r.run(); - } catch (Throwable e) { - LOGGER.log(Level.FINE, "JRebel support failed to load", e); - } - } - - @Override - public void buildViewDispatchers(MetaClass owner, List dispatchers) { - if (metaClasses != null && owner.klass.clazz instanceof Class) { - synchronized (metaClasses) { - metaClasses.put((Class) owner.klass.clazz, owner); - } - } - } - - @Override - public RequestDispatcher createRequestDispatcher(RequestImpl request, Klass type, Object it, String viewName) { - return null; - } - - @Override - public void buildIndexDispatchers(MetaClass owner, List dispatchers) { - // no-op - } - - @Override - public boolean handleIndexRequest(RequestImpl req, ResponseImpl rsp, Object node, MetaClass nodeMetaClass) { - return false; - } - - private static final Logger LOGGER = Logger.getLogger(JRebelFacet.class.getName()); -} diff --git a/pom.xml b/pom.xml index 76d0ce7a2..e54e3955a 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,6 @@ jsp jelly groovy - jrebel