Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.jboss.as.server;
- import java.util.concurrent.ConcurrentSkipListSet;
- import org.jboss.as.server.deployment.DeploymentPhaseContext;
- import org.jboss.as.server.deployment.DeploymentUnit;
- import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
- import org.jboss.as.server.deployment.DeploymentUnitProcessor;
- import org.jboss.as.server.deployment.Phase;
- import org.jboss.as.server.deployment.SubDeploymentProcessor;
- import org.jboss.as.server.deployment.annotation.AnnotationIndexProcessor;
- import org.jboss.as.server.deployment.module.DeploymentRootExplodedMountProcessor;
- import org.jboss.as.server.deployment.module.DeploymentRootMountProcessor;
- import org.jboss.as.server.deployment.module.ManifestAttachmentProcessor;
- import org.jboss.as.server.deployment.module.ModuleIdentifierProcessor;
- public class InfiniteLoop {
- public static void main(String[] args) {
- ConcurrentSkipListSet<RegisteredProcessor> set = new ConcurrentSkipListSet<RegisteredProcessor>();
- set.add(new RegisteredProcessor(Phase.STRUCTURE_SERVICE_MODULE_LOADER, new DeploymentUnitProcessor() {
- public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
- }
- public void undeploy(DeploymentUnit context) {
- }
- }));
- set.add(new RegisteredProcessor(Phase.STRUCTURE_EXPLODED_MOUNT, new DeploymentRootExplodedMountProcessor()));
- set.add(new RegisteredProcessor(Phase.STRUCTURE_MOUNT, new DeploymentRootMountProcessor()));
- set.add(new RegisteredProcessor(Phase.STRUCTURE_MANIFEST, new ManifestAttachmentProcessor()));
- set.add(new RegisteredProcessor(Phase.STRUCTURE_ADDITIONAL_MANIFEST, new ManifestAttachmentProcessor()));
- set.add(new RegisteredProcessor(Phase.STRUCTURE_SUB_DEPLOYMENT, new SubDeploymentProcessor()));
- set.add(new RegisteredProcessor(Phase.STRUCTURE_MODULE_IDENTIFIERS, new ModuleIdentifierProcessor()));
- set.add(new RegisteredProcessor(Phase.STRUCTURE_ANNOTATION_INDEX, new AnnotationIndexProcessor()));
- System.out.println("Items in set:" + set.size());
- }
- static final class RegisteredProcessor implements Comparable<RegisteredProcessor> {
- private final int priority;
- private final DeploymentUnitProcessor processor;
- private static int i = 1;
- RegisteredProcessor(final int priority, final DeploymentUnitProcessor processor) {
- this.priority = priority;
- this.processor = processor;
- }
- public int compareTo(final RegisteredProcessor o) {
- final int rel = Integer.signum(priority - o.priority);
- // BUG below
- return rel == 0 ? Integer.signum(processor.getClass().getName().compareTo(o.getClass().getName())) : rel;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement