Returns the AnycastInputHandler associated with this AIStream
@return
498599
public AnycastInputHandler getAnycastInputHandler()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
    {
      SibTr.entry(tc, "getAnycastInputHandler");
      SibTr.exit(tc, "getAnycastInputHandler", _parent);
    }
    return _parent;
  }
281177
@Override
    public InputHandler getInputHandler(ProtocolType type, SIBUuid8 sourceMEUuid, JsMessage msg)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "getInputHandler",
                        new Object[] { type, sourceMEUuid, msg });

        InputHandler msgHandler = null;

        if (type == ProtocolType.UNICASTINPUT)
        {
            msgHandler = getInputHandler();
        }
        else if (type == ProtocolType.PUBSUBINPUT)
        {
            msgHandler = getInputHandler();
        }
        else if (type == ProtocolType.ANYCASTINPUT)
        {

            // For durable, AIHs are referenced by pseudo destination ID so check for that first
            SIBUuid12 destID = msg.getGuaranteedTargetDestinationDefinitionUUID();
            SIBUuid12 gatheringTargetDestUuid = msg.getGuaranteedGatheringTargetUUID();

            msgHandler = _protoRealization.
                            getRemoteSupport().
                            getAnycastInputHandlerByPseudoDestId(destID);

            // Otherwise, use the uuid of the sourceCellule ME to find the RCD to deliver the message. We assume that this
            // uuid corresponds to that used to choose the RCD initially, and that was used by the associated
            // AIH as the uuid of the DME to which it sent the request for the message.
            if (msgHandler == null)
                msgHandler = getAnycastInputHandler(sourceMEUuid, gatheringTargetDestUuid, true);
        }
        //else
        //{
        //unsupported protocol type
        //return null
        //}

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "getInputHandler", msgHandler);

        return msgHandler;
    }
477759
public static final KeyPressHandler getCurrencyKeyPressHandler() { // NOPMD it's thread save!
    if (HandlerFactory.currencyKeyPressHandler == null) {
      synchronized (CurrencyKeyPressHandler.class) {
        if (HandlerFactory.currencyKeyPressHandler == null) {
          HandlerFactory.currencyKeyPressHandler = new CurrencyKeyPressHandler();

        }
      }
    }
    return HandlerFactory.currencyKeyPressHandler;
  }
212601
@Override
    public ControlHandler getControlHandler(SIBUuid8 sourceMEUuid)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(
                        tc,
                        "getControlHandler",
                        new Object[] { sourceMEUuid, this });

        ControlHandler msgHandler =
                        (ControlHandler) _localisationManager.
                                        getQueuePointOutputHandler(sourceMEUuid);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "getControlHandler", msgHandler);

        return msgHandler;
    }
86231
@Override
    public HashMap getAllPubSubOutputHandlers()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "getAllPubSubOutputHandlers");

        HashMap handlers =
                        _pubSubRealization.getAllPubSubOutputHandlers();

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "getAllPubSubOutputHandlers", handlers);

        return handlers;
    }
155856
ManagementRequestHandler<Void, Void> getCloseHandler() {
        return new AbstractAttachmentHandler() {
            @Override
            void handleRequest(TimedStreamEntry entry, FlushableDataOutput output) throws IOException {
                // no-op as AbstractAttachmentHandler will close the entry after calling this
            }

            @Override
            void handleMissingStream(int requestId, int index, FlushableDataOutput output) throws IOException {
                // no-op as there's nothing to do
            }
        };
    }
1083619
public Mono<InputStream> asInputStream() {
		return handle((bb, sink) -> {
			try {
				sink.next(new ReleasingInputStream(bb));
			}
			catch (IllegalReferenceCountException e) {
				sink.complete();
			}
		});
	}
136271
public AnycastInputHandler getAnycastInputHandler(SIBUuid8 dmeId,
                                                    SIBUuid12 gatheringTargetDestUuid,
                                                    DestinationDefinition definition,
                                                    boolean createAIH)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(tc, 
                  "getAnycastInputHandler",
                  new Object[]{ 
                  dmeId,
                  gatheringTargetDestUuid,
                  definition,
                  Boolean.valueOf(createAIH)});

    AnycastInputHandler aih = null;
    String key = SIMPUtils.getRemoteGetKey(dmeId, gatheringTargetDestUuid);

    synchronized (_anycastInputHandlers)
    {
      aih = _anycastInputHandlers.get(key);
      if (aih == null && createAIH && !_toBeDeleted)
      {
        aih = createAIHandRCD(dmeId, gatheringTargetDestUuid, definition, false);
        _anycastInputHandlers.put(key, aih);
      }
    }
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getAnycastInputHandler", aih);

    return aih;
  }
1170965
public OutputHandler getOutputHandler()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
    {
      SibTr.entry(tc, "getOutputHandler");
      SibTr.exit(tc, "getOutputHandler", outputHandler);
    }    
    
    return outputHandler;
  }
635678
public IScopeHandler getHandler() {
        log.trace("getHandler from {}", name);
        if (handler != null) {
            return handler;
        } else if (hasParent()) {
            return getParent().getHandler();
        } else {
            return null;
        }
    }
961915
private AnycastInputHandler createAIHandRCD(SIBUuid8 dmeId, 
                                              SIBUuid12 gatheringTargetDestUuid,
                                              DestinationDefinition definition,
                                              boolean restartFromStaleBackup)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(tc, 
                  "createAIHandRCD",
                  new Object[]{ 
                  dmeId,
                  gatheringTargetDestUuid,
                  definition,
                  Boolean.valueOf(restartFromStaleBackup)});
                  
    AnycastInputHandler aih = null;
    AIContainerItemStream aiContainerItemStream = null;
    PtoPReceiveMsgsItemStream rcdItemStream = null;
    String key = SIMPUtils.getRemoteGetKey(dmeId, gatheringTargetDestUuid);

    try
    {
      // check if either item stream already exists
      aiContainerItemStream = _aiContainerItemStreams.get(key);
      rcdItemStream = _rcdItemStreams.get(key);
      if (aiContainerItemStream == null || rcdItemStream == null)
      {
        LocalTransaction tran = _baseDestinationHandler.getTransactionManager().createLocalTransaction(true);

        // create aiContainerItemStream if necessary
        if (aiContainerItemStream == null)
        {
          aiContainerItemStream = new AIContainerItemStream(dmeId, gatheringTargetDestUuid, null, null, null);
          _baseDestinationHandler.addItemStream(aiContainerItemStream, (Transaction) tran);
        }

        // create rcdItemStream if necessary
        if (rcdItemStream == null)
        {
          rcdItemStream = new PtoPReceiveMsgsItemStream(_baseDestinationHandler, dmeId, null);
          _baseDestinationHandler.addItemStream(rcdItemStream, (Transaction) tran);
          
          // Configure destination depth parameters for the PtoPReceiveMsgsItemStream (defect 559096)
          // Set the default limits on the Itemstream
          rcdItemStream.setDefaultDestLimits();
          // Setup any message depth interval checking in line with 510343
          rcdItemStream.setDestMsgInterval();
        }

        tran.commit();
        
        // If commit succeeded, add streams to map
        _aiContainerItemStreams.put(key, aiContainerItemStream);
        _rcdItemStreams.put(key, rcdItemStream);
      }

      aih =
        new AnycastInputHandler(
          definition.getName(),
          definition.getUUID(),
          definition.isReceiveExclusive(),
          _messageProcessor,
          aiContainerItemStream,
          dmeId,
          gatheringTargetDestUuid,
          _destinationManager.getAsyncUpdateThread(),
          _baseDestinationHandler,
          restartFromStaleBackup);
      RemoteConsumerDispatcher rcd =
        new RemoteConsumerDispatcher(
          _baseDestinationHandler, definition.getName(),
          rcdItemStream,
          new ConsumerDispatcherState(),
          aih,
          _baseDestinationHandler.getTransactionManager(),
          definition.isReceiveExclusive());
      rcd.setReadyForUse();

      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        SibTr.debug(tc, "RCD created " + rcd);

    }
    catch (Exception e)
    {
      // Exception shouldn't occur so FFDC and rethrow as runtime exception
      FFDCFilter.processException(
        e,
        "com.ibm.ws.sib.processor.impl.destination.AbstractRemoteSupport.createAIHandRCD",
        "1:961:1.25",
        this);

      SIErrorException e2 =
        new SIErrorException(
          nls.getFormattedMessage(
            "INTERNAL_MESSAGING_ERROR_CWSIP0002",
            new Object[] { "com.ibm.ws.sib.processor.impl.destination.AbstractRemoteSupport.createAIHandRCD", "1:968:1.25", e },
            null),
        e);

      SibTr.exception(tc, e);
      SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
        new Object[] {
          "com.ibm.ws.sib.processor.impl.destination.AbstractRemoteSupport.createAIHandRCD",
          "1:976:1.25",
          e });

      // Don't throw exception if destination is being deleted, it is a message store invalid add
      // operation, and we're not being reconstituted with startMode == JsConstants.ME_START_FLUSH
      // Defect 222966
      if (_toBeDeleted && e instanceof InvalidAddOperation && !restartFromStaleBackup)
      {
        // Not throwing exception, make sure we return null
        aih = null;
      }
      else
      {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
          SibTr.exit(tc, "createAIHandRCD", aih);
        
        throw e2;
      }
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "createAIHandRCD", aih);

    return aih;
  }
485756
@SuppressWarnings("unchecked")
    public <T> TypeHandler<T> getInstance(Class<?> javaTypeClass, Class<?> typeHandlerClass) {
        if (javaTypeClass != null) {
          try {
            Constructor<?> c = typeHandlerClass.getConstructor(Class.class);
            return (TypeHandler<T>) c.newInstance(javaTypeClass);
          } catch (NoSuchMethodException ignored) {
            // ignored
          } catch (Exception e) {
            throw new TypeException("Failed invoking constructor for handler " + typeHandlerClass, e);
          }
        }
        try {
          Constructor<?> c = typeHandlerClass.getConstructor();
          return (TypeHandler<T>) c.newInstance();
        } catch (Exception e) {
          throw new TypeException("Unable to find a usable constructor for " + typeHandlerClass, e);
        }
      }
418662
public @Nullable InputStream getInputStream() {
    if (mInputStreamSupplier != null) {
      return mInputStreamSupplier.get();
    }
    CloseableReference<PooledByteBuffer> pooledByteBufferRef =
        CloseableReference.cloneOrNull(mPooledByteBufferRef);
    if (pooledByteBufferRef != null) {
      try {
        return new PooledByteBufferInputStream(pooledByteBufferRef.get());
      } finally {
        CloseableReference.closeSafely(pooledByteBufferRef);
      }
    }
    return null;
  }
969302
@Override
    public boolean flushQueuePointOutputHandler()
                    throws SIResourceException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(
                        tc,
                        "flushQueuePointOutputHandler", this);

        boolean done = _localisationManager.flushQueuePointOutputHandler();

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "flushQueuePointOutputHandler", Boolean.valueOf(done));
        return done;
    }
1097305
public static FormInputHandler create() {
		return new FormInputHandler(WebElementFinder.create().noLogging(true), null, null, null, null, null, null, null, null);
	}
827887
private Object getHandler(NativeFunction atmosFunction,
			Class<? extends AbstractNativeFunctionHandler> handlerTypeClass) {
		Object handler = null;

		try {
			Constructor<?> handlerConst = handlerTypeClass
					.getConstructor(NativeFunction.class, Global.class);
			handler = handlerConst.newInstance(atmosFunction, global);

		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return handler;
	}
584967
private static ConnectionHandler<Integer, Integer> numberIncrementingHandler() {
        return conn -> conn.writeAndFlushOnEach(conn.getInput().map(anInt -> ++anInt));
    }