protected void register(AbstractProcessor<S> processor) {
   if (getProtocol().getDomain() != null) {
     synchronized (this) {
       try {
         long count = registerCount.incrementAndGet();
         RequestInfo rp = processor.getRequest().getRequestProcessor();
         rp.setGlobalProcessor(global);
         ObjectName rpName =
             new ObjectName(
                 getProtocol().getDomain()
                     + ":type=RequestProcessor,worker="
                     + getProtocol().getName()
                     + ",name="
                     + getProtocol().getProtocolName()
                     + "Request"
                     + count);
         if (getLog().isDebugEnabled()) {
           getLog().debug("Register " + rpName);
         }
         Registry.getRegistry(null, null).registerComponent(rp, rpName, null);
         rp.setRpName(rpName);
       } catch (Exception e) {
         getLog().warn("Error registering request");
       }
     }
   }
 }
 protected void unregister(Processor<S> processor) {
   if (getProtocol().getDomain() != null) {
     synchronized (this) {
       try {
         Request r = processor.getRequest();
         if (r == null) {
           // Probably an UpgradeProcessor
           return;
         }
         RequestInfo rp = r.getRequestProcessor();
         rp.setGlobalProcessor(null);
         ObjectName rpName = rp.getRpName();
         if (getLog().isDebugEnabled()) {
           getLog().debug("Unregister " + rpName);
         }
         Registry.getRegistry(null, null).unregisterComponent(rpName);
         rp.setRpName(null);
       } catch (Exception e) {
         getLog().warn("Error unregistering request", e);
       }
     }
   }
 }