Registers a new SASL mechanism.

@param mechanism a SASLMechanism subclass.
962389
public static void registerSASLMechanism(SASLMechanism mechanism) {
        synchronized (REGISTERED_MECHANISMS) {
            REGISTERED_MECHANISMS.add(mechanism);
            Collections.sort(REGISTERED_MECHANISMS);
        }
    }
328216
private void registerMethod(Class<?> type, Method method) {
    Class<?> returnType = method.getReturnType();
    if (returnType == void.class || returnType == Void.class) {
      registerVoidMethod(type, method);
    } else {
      registerValueMethod(type, method);
    }
  }
384828
private void registerInternal(final Object receiver, final Method method, final Class<? extends T> eventClass) {

		List<ReceiverDescriptor> receivers = this.receiverMap.get(eventClass);
		if (receivers == null) {
			receivers = new LinkedList<ReceiverDescriptor>();
			this.receiverMap.put(eventClass, receivers);
		}

		final ReceiverDescriptor rd = new ReceiverDescriptor();
		rd.receiverReference = new SoftReference<Object>(receiver);
		rd.method = method;

		receivers.add(rd);
	}
332292
void registerDestination()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "registerDestination");

    //Only register the destination once its been defined to WLM
    if (_mqLinkManager.isDefined(getUuid()))
    {
      if ((hasLocal()) && (!_registeredInWLM))
      {
        try
        {
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            SibTr.debug(tc, "Register MQLink: " + getUuid() + ", with linkManager");           
          _linkManager.register(getUuid());
          _registeredInWLM = true;
        }
        catch (LinkException e)
        {
          //Error during create of the link.  Trace an FFST.  If we cant 
          //advertise the link, other ME's wont be able to send to it
          FFDCFilter.processException(
            e,
            "com.ibm.ws.sib.processor.impl.MQLinkHandler.registerDestination",
            "1:724:1.71",
            this);
    
          SibTr.exception(tc, e);
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
            SibTr.exit(tc, "registerDestination", e);
        }
      }
    }
        
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "registerDestination");  
      
    return;
  }
456086
public static void register(MetricsRegistry metricsRegistry) {
        checkNotNull(metricsRegistry, "metricsRegistry");

        OperatingSystemMXBean mxBean = ManagementFactory.getOperatingSystemMXBean();

        registerMethod(metricsRegistry, mxBean, "getCommittedVirtualMemorySize", "os.committedVirtualMemorySize");
        registerMethod(metricsRegistry, mxBean, "getFreePhysicalMemorySize", "os.freePhysicalMemorySize");
        registerMethod(metricsRegistry, mxBean, "getFreeSwapSpaceSize", "os.freeSwapSpaceSize");
        registerMethod(metricsRegistry, mxBean, "getProcessCpuTime", "os.processCpuTime");
        registerMethod(metricsRegistry, mxBean, "getTotalPhysicalMemorySize", "os.totalPhysicalMemorySize");
        registerMethod(metricsRegistry, mxBean, "getTotalSwapSpaceSize", "os.totalSwapSpaceSize");
        registerMethod(metricsRegistry, mxBean, "getMaxFileDescriptorCount", "os.maxFileDescriptorCount");
        registerMethod(metricsRegistry, mxBean, "getOpenFileDescriptorCount", "os.openFileDescriptorCount");

        // value will be between 0.0 and 1.0 or a negative value, if not available
        registerMethod(metricsRegistry, mxBean, "getProcessCpuLoad", "os.processCpuLoad", PERCENTAGE_MULTIPLIER);

        // value will be between 0.0 and 1.0 or a negative value, if not available
        registerMethod(metricsRegistry, mxBean, "getSystemCpuLoad", "os.systemCpuLoad", PERCENTAGE_MULTIPLIER);

        metricsRegistry.register(mxBean, "os.systemLoadAverage", MANDATORY,
                new DoubleProbeFunction<OperatingSystemMXBean>() {
                    @Override
                    public double get(OperatingSystemMXBean bean) {
                        return bean.getSystemLoadAverage();
                    }
                }
        );
    }
248985
public static void register(final ProteinModification modification) {
		if (modification==null) throw new IllegalArgumentException("modification == null!");

		lazyInit();

		String id = modification.getId();
		if (byId.containsKey(id)) {
			throw new IllegalArgumentException(id+" has already been registered.");
		}

		registry.add(modification);
		byId.put(id, modification);

		ModificationCategory cat = modification.getCategory();
		byCategory.get(cat).add(modification);

		ModificationOccurrenceType occType = modification.getOccurrenceType();
		byOccurrenceType.get(occType).add(modification);


		ModificationCondition condition = modification.getCondition();
		List<Component> comps = condition.getComponents();
		for (Component comp:comps) {
			Set<ProteinModification> mods = byComponent.get(comp);
			if (mods==null) {
				mods = new HashSet<ProteinModification>();
				byComponent.put(comp, mods);
			}
			mods.add(modification);
		}

		String pdbccId = modification.getPdbccId();
		if (pdbccId!=null) {
			Set<ProteinModification> mods = byPdbccId.get(pdbccId);
			if (mods==null) {
				mods = new HashSet<ProteinModification>();
				byPdbccId.put(pdbccId, mods);
			}
			mods.add(modification);
		}

		String residId = modification.getResidId();
		if (residId!=null) {
			Set<ProteinModification> mods = byResidId.get(residId);
			if (mods==null) {
				mods = new HashSet<ProteinModification>();
				byResidId.put(residId, mods);
			}
			mods.add(modification);
		}

		String psimodId = modification.getPsimodId();
		if (psimodId!=null) {
			Set<ProteinModification> mods = byPsimodId.get(psimodId);
			if (mods==null) {
				mods = new HashSet<ProteinModification>();
				byPsimodId.put(psimodId, mods);
			}
			mods.add(modification);
		}

		for (String keyword : modification.getKeywords()) {
			Set<ProteinModification> mods = byKeyword.get(keyword);
			if (mods==null) {
				mods = new HashSet<ProteinModification>();
				byKeyword.put(keyword, mods);
			}
			mods.add(modification);
		}
	}
277956
@XmlElement(name = "authentication-mechanism-type", required = true)
    public void setAuthenticationMechanismType(String authMech) {
        AuthenticationMechanismType type = AuthenticationMechanismType.valueOf(authMech);
        authenticationMechanismType = type.name();
    }
943694
static void register(Class<? extends URLStreamHandler> handlerClass) {
    checkArgument("Handler".equals(handlerClass.getSimpleName()));

    String pkg = handlerClass.getPackage().getName();
    int lastDot = pkg.lastIndexOf('.');
    checkArgument(lastDot > 0, "package for Handler (%s) must have a parent package", pkg);

    String parentPackage = pkg.substring(0, lastDot);

    String packages = System.getProperty(JAVA_PROTOCOL_HANDLER_PACKAGES);
    if (packages == null) {
      packages = parentPackage;
    } else {
      packages += "|" + parentPackage;
    }
    System.setProperty(JAVA_PROTOCOL_HANDLER_PACKAGES, packages);
  }
651238
public final <T> void registerType(Class<T> runtimeClass, TypeHandler<T> handler) {
        if (started) {
            // Can't add any more metrics anyway; harmless
            return;
        }
        typeHandlers.put(runtimeClass, handler);
    }
1368834
private ServiceRegistration<?> registerMBeanService(String jmsResourceName, BundleContext bundleContext) {
        Dictionary<String, String> props = new Hashtable<String, String>();
        props.put(KEY_SERVICE_VENDOR, "IBM");

        JmsServiceProviderMBeanImpl jmsProviderMBean = new JmsServiceProviderMBeanImpl(getServerName(), KEY_JMS2_PROVIDER);
        props.put(KEY_JMX_OBJECTNAME, jmsProviderMBean.getobjectName());

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "JmsQueueMBeanImpl=" + jmsProviderMBean.getobjectName() + " props=" + props);
        }
        return bundleContext.registerService(JmsServiceProviderMBeanImpl.class, jmsProviderMBean, props);
    }
764045
public void register() {
		registrations.add(editService.addGeometryEditMoveHandler(this));
		registrations.add(editService.addGeometryEditShapeChangedHandler(this));
		registrations.add(editService.addGeometryEditTentativeMoveHandler(this));
		registrations.add(editService.addGeometryEditChangeStateHandler(this));
	}
441628
private void registerNativeFunctionHandlers(
			Map<String, HandlerDefinition> mappingInfos,
			Class<? extends AbstractNativeFunctionHandler> handlerClassType)
			throws SecurityException, NoSuchMethodException {

		Iterator<Entry<String, HandlerDefinition>> iterator = mappingInfos.entrySet()
				.iterator();

		while (iterator.hasNext()) {
			Entry<String, HandlerDefinition> mappingInfo = iterator.next();
			
			String url = mappingInfo.getKey();
			HandlerDefinition handlerDefinition = mappingInfo.getValue();
			
			registerNativeFunctionHandler(url, handlerDefinition, handlerClassType);
		}
	}
283930
public static Map<String, String> getRegisterdSASLMechanisms() {
        Map<String, String> answer = new LinkedHashMap<>();
        synchronized (REGISTERED_MECHANISMS) {
            for (SASLMechanism mechanism : REGISTERED_MECHANISMS) {
                answer.put(mechanism.getClass().getName(), mechanism.toString());
            }
        }
        return answer;
    }
269749
public synchronized EventScope<T> register(final Class<? extends T> eventClass, final Object receiver,
			final Method handler) {

		this.registerInternal(receiver, handler, eventClass);
		return this;

	}
1088290
private void register(WebSocketWireProtocol wireProtocolVersion, WsHandshakeValidator validator) {
        if ( wireProtocolVersion == null ) {
            throw new NullPointerException("wireProtocolVersion");
        }
        if ( validator == null ) {
            throw new NullPointerException("validator");
        }

        WsHandshakeValidator existingValidator =
                handshakeValidatorsByWireProtocolVersion.put(wireProtocolVersion, validator);

        logger.trace("Class "+validator.getClass().getName()+" registered to support websocket handshake for protocol "+wireProtocolVersion);
        if ( existingValidator != null ) {
            logger.trace("Multiple handshake validators have registered to support wire protocol "+wireProtocolVersion+". Using class "+this.getClass().getName()+'.');
        }
    }
70917
private void handleListMechsResponse(final ChannelHandlerContext ctx, final ByteBuf msg) throws Exception {
    String remote = ctx.channel().remoteAddress().toString();
    String[] supportedMechanisms = SaslListMechsResponse.supportedMechs(msg);
    if (supportedMechanisms.length == 0) {
      throw new AuthenticationException("Received empty SASL mechanisms list from server: " + remote);
    }

    saslClient = Sasl.createSaslClient(supportedMechanisms, null, "couchbase", remote, null, this);
    selectedMechanism = saslClient.getMechanismName();

    byte[] bytePayload = saslClient.hasInitialResponse() ? saslClient.evaluateChallenge(new byte[]{}) : null;
    ByteBuf payload = bytePayload != null ? ctx.alloc().buffer().writeBytes(bytePayload) : Unpooled.EMPTY_BUFFER;

    ByteBuf request = ctx.alloc().buffer();
    SaslAuthRequest.init(request);
    SaslAuthRequest.mechanism(selectedMechanism, request);
    SaslAuthRequest.challengeResponse(payload, request);
    payload.release();

    ChannelFuture future = ctx.writeAndFlush(request);
    future.addListener(new GenericFutureListener<Future<Void>>() {
      @Override
      public void operationComplete(Future<Void> future) throws Exception {
        if (!future.isSuccess()) {
          LOGGER.warn("Error during SASL Auth negotiation phase.", future);
          originalPromise().setFailure(future.cause());
        }
      }
    });
  }
1048706
private void invokeDestroy(String method, String name) {
        Class clazz = this.jmsServerManager().getClass();
        Method destroy = null;
        for (Method each: clazz.getMethods()) {
            if (method.equals(each.getName())) {
                destroy = each;
                break;
            }
        }

        if (destroy == null) {
            throw new IllegalStateException(String.format("Class %s has no %s method", clazz, method));
        }

        try {
            if (destroy.getParameterTypes().length == 1) {
                destroy.invoke(this.jmsServerManager(), name);
            } else {
                destroy.invoke(this.jmsServerManager(), name, true);
            }
        } catch (IllegalAccessException | InvocationTargetException e) {
            throw new RuntimeException("Failed to destroy destination " + name, e);
        }
    }