Sends the proxy subscriptions to this Neighbour.

Pulls all the subscriptions that have been sent to this
Bus and builds a message that will be sent to this Neighbour.

@exception SIResourceException
347032
void sendRequestProxySubscriptions() throws SIResourceException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "sendRequestProxySubscriptions");

    // Generate the subscription message that will be sent to this neighbour.
    SubscriptionMessage message = iBusGroup.generateResetSubscriptionMessage();

    if (message !=null)
    {
      message.setSubscriptionMessageType(SubscriptionMessageType.REQUEST);
      // Send to the Neighbour.
      sendToNeighbour(message, null);
    }
    else
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        SibTr.debug(
          tc,
          "No subscriptions to forward to ME " + iMEUuid.toString());

    setRequestedProxySubscriptions();

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "sendRequestProxySubscriptions");
  }
440123
@Override
    public void send(Message msg) throws JMSException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "send", msg);

        //Defer straight through to the version with completion listner (which will do all the locking and checking).
        send_internal(msg, null);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "send");
    }
169194
public VasSubscriberService createVasSubscriberService(String deliveryAddress) {
        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
        factory.setServiceClass(VasSubscriberService.class);

        factory.setAddress(deliveryAddress);

        SoapBindingConfiguration conf = new SoapBindingConfiguration();
        conf.setVersion(Soap12.getInstance());
        factory.setBindingConfig(conf);
        factory.getFeatures().add(new WSAddressingFeature());
        VasSubscriberService vasSubscriberService = (VasSubscriberService) factory.create();

        //Force the use of the Async transport, even for synchronous calls
        ((BindingProvider) vasSubscriberService).getRequestContext().put("use.async.http.conduit", Boolean.TRUE);

        return vasSubscriberService;
    }
1031895
public static QueryRunner createProxy(final DataSourceFactory dataSourceFactory) {
        final QueryRunnerInterceptor handler = new QueryRunnerInterceptor(dataSourceFactory);

        final Enhancer e = new Enhancer();

        // make sure we're Serializable and have a write replace method
        e.setInterfaces(new Class[] { Serializable.class, IWriteReplace.class });
        e.setSuperclass(QueryRunner.class);
        e.setCallback(handler);
        e.setNamingPolicy(new DefaultNamingPolicy() {
            @Override
            public String getClassName(final String prefix,
                                       final String source,
                                       final Object key,
                                       final Predicate names) {
                return super.getClassName("PROXY_" + prefix, source, key, names);
            }
        });

        LOG.trace("Created proxy for an EntityManager");

        return (QueryRunner)e.create();

    }
657727
public void start() throws Exception {
        tracker = new ServiceTracker<ProxyTargetLocatorFactory, ProxyTargetLocatorFactory>(bundleContext,
            ProxyTargetLocatorFactory.class, null);
        tracker.open();
        bundleInjectionProviderHelper =
            new BundleInjectionProviderHelper(bundleContext, applicationName, injectionSource, tracker);
        bundleInjectionProviderHelper.register();
    }
14881
void sendCODMessage(SIMPMessage msg, TransactionCommon tran) throws SIResourceException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "sendCODMessage", new Object[] { msg, tran });

        // If COD Report messages are required, this is when we need to create and
        // send them.

        if (msg.getReportCOD() != null)
        {
            // Create the ReportHandler object if not already created
            if (_reportHandler == null)
                _reportHandler = new ReportHandler(messageProcessor);

            try
            {
                _reportHandler.handleMessage(msg, tran, SIApiConstants.REPORT_COD);
            } catch (SIException e)
            {
                FFDCFilter.processException(
                                            e,
                                            "com.ibm.ws.sib.processor.impl.BaseDestinationHandler.sendCODMessage",
                                            "1:3909:1.700.3.45",
                                            this);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(tc, "sendCODMessage", "SIResourceException");
                throw new SIResourceException(
                                nls.getFormattedMessage(
                                                        "REPORT_MESSAGE_ERROR_CWSIP0423",
                                                        new Object[] { messageProcessor.getMessagingEngineName(), e },
                                                        null),
                                e);
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "sendCODMessage");
    }
23824
public void reconstitute(BaseDestinationHandler destinationHandler) throws SIResourceException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "reconstitute", destinationHandler); 

    super.reconstitute(destinationHandler);
      
    _destHighMsgs = destinationHandler.getMessageProcessor().getHighMessageThreshold();

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
    {
      SibTr.exit(tc, "reconstitute");           
    }
  }
358461
synchronized void dispatch(final List messages, AsynchDispatchScheduler scheduler, SibRaListener listener) throws ResourceException {

    	final String methodName = "dispatch";
    	if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
    		SibTr.entry(this, TRACE, methodName, new Object[] {messages, scheduler, listener});
    	}

    	if (_session == null) {

    		/*
    		 * The dispatcher has been closed - return safe in the knowledge
    		 * that the messages will have already been unlocked by the close of
    		 * the session
    		 */

    		if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
    			SibTr.exit(this, TRACE, methodName);
    		}
    		return;

    	}

    	/*
    	 * Keep a list of the messages for which delivery has not been attempted
    	 */

    	final List undeliveredDispatchableMessages = new ArrayList(messages);


    	/**
    	 * The endpoint to deliver the message to.
    	 */
    	MessageEndpoint endpoint = null;

    	try {

    		/*
    		 * Obtain an endpoint
    		 */
    		endpoint = createEndpoint();

    		/*
    		 * Obtain information for request metrics and handlers
    		 */
    		final SIDestinationAddress destination = _session
    				.getDestinationAddress();
    		final String busName = destination.getBusName();
    		final String meName = _connection.getMeName();
    		final String destinationName = destination.getDestinationName();
    		final String messageSelector = _endpointConfiguration
    				.getMessageSelector();
    		final ActivationSpec activationSpec = _endpointConfiguration
    				.getActivationSpec();

    		for (final Iterator iterator = messages.iterator(); iterator
    				.hasNext()
    				&& !isCancelled ();) {

    			final DispatchableMessage dispatchableMessage = (DispatchableMessage) iterator.next();

    			final SIBusMessage message = dispatchableMessage.getMessage();
    			boolean success = false;
    			try {

    				beforeDelivery(message, endpoint);

    				undeliveredDispatchableMessages.remove(dispatchableMessage);


    				try {

    					// 304501.ra - Call the pre MDB invoke on XD
    					MessagePacingControl mpc = MessagePacingControlFactory.getInstance();
    					if (mpc != null && mpc.isActive()) {

    						mpc.preMdbInvoke(this, scheduler);

    					}

    					_reliabilityPreInvoke.put(message.getMessageHandle(), message.getReliability());

    					success = _invoker.invokeEndpoint(endpoint,
    							message, _session, getTransaction(), _debugMEName);

    					// 304501.ra - Call the post MDB invoke method on XD
    					if (mpc != null && mpc.isActive()) {

    						mpc.postMdbInvoke (this, scheduler);

    					}

    				} finally {

    					afterDelivery(message, endpoint, success);

    				}

    			} finally {


    				// Call isTransactionRolledBack to clear up
    				// the data stored in the SibRaXaResource hashtable even if
    				// we are not using PMI
    				boolean tranRolledBack = isTransactionRolledBack ();

    				// Success should only be true if the endpoint
    				// was successfully invoked and the transaction
    				// was not rolled back.
    				success = success && !tranRolledBack;

    				if (success)
    				{
    					//This message was sucessfully delivered so reset all sequential message counters
    					clearSequentialFailureMessageCount();
    				}
    				else
    				{
    					// Make sure we have a message and the redelivered count exists
    					if ((message != null) && (((JsMessage)message).getRedeliveredCount() != null))
    					{
    						// message failed check its redelivery threshold
    						// we need to check for n - 1 where n is the max failed deliveries. The redeliveredCount means the 
    						// number of REdeliveries so we need to add one to this to align with the maxfaileddeliveries count.
    						if ( (((JsMessage)message).getRedeliveredCount().intValue() + 1) == (_maxFailedDeliveries - 1))
    						{
    							//We are about to hit the threshold
    							addToSequentialFailureMessageCount();
    						}
    					}
    					else
    					{
    						if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) 
    						{
    							if (null == message)
    							{
    								SibTr.debug(TRACE, "The message was null");
    							}
    							else
    							{
    								SibTr.debug(TRACE, "Unable to obtain the redelivered count from message " + message);
    							}
    						}
    					}
    				}

    			}


    		}

    	} finally {

    		cleanup();

    		try {

    			// If possible, unlock any undelivered messages

    			if (undeliveredDispatchableMessages.size() > 0) {

    				try {

    					// If we delete best effort non persistent messages then
    					// remove any best effort non persitent messages from the
    					// list.
    					if (_deleteUnrecoverableMessages) {

    						for (final Iterator iterator = undeliveredDispatchableMessages
    								.iterator(); iterator.hasNext();) {

    							final DispatchableMessage dispatchableMsg = (DispatchableMessage) iterator.next();
    							final SIBusMessage msg = dispatchableMsg.getMessage();

    							if (_unrecoverableReliability.compareTo(msg.getReliability ()) >= 0) {

    								if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
    									SibTr.debug(this,
    											TRACE,
    											"Removing the following message as it has already been deleted: ",
    											msg);
    								}

    								iterator.remove();

    							}

    						}

    					}

    					// Make sure that we still have some undelivered messages
    					// since they may have all been deleted
    					if (undeliveredDispatchableMessages.size() > 0) {

    						if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
    							SibTr.debug(this, TRACE,
    									"Unlocking undelivered messages:",
    									undeliveredDispatchableMessages);
    						}

    						unlockMessages(undeliveredDispatchableMessages, false);

    					}

    				} catch (final ResourceException exception) {

    					// No FFDC code needed
    					if (TraceComponent.isAnyTracingEnabled() && TRACE.isEventEnabled()) {
    						SibTr.exception(this, TRACE, exception);
    					}

    				}

    			}

    		} finally {

    			if (endpoint != null) {

    				endpoint.release();

    			}
    		}


    	}

    	if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
    		SibTr.exit(this, TRACE, methodName);
    	}

    }
74104
@Override
    public UndeliverableReturnCode handleUndeliverableMessage(
                                                              SIMPMessage msg,
                                                              int exceptionReason,
                                                              String[] exceptionInserts,
                                                              TransactionCommon tran)
                    throws
                    SIResourceException
    {
        // F001333-14610
        // Delegate down onto the new method passing a null
        // subscription ID.
        return handleUndeliverableMessage(msg, exceptionReason, exceptionInserts, tran, null);
    }
1232748
public boolean updateSourceStream(MessageItem msg, boolean rollback) throws SIResourceException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "updateSourceStream", new Object[] { msg, new Boolean(rollback)});
      
    
    // return flag indicating whether the message can be sent downstream
    boolean sendMessage = true;    

    // Write the value message to the stream
    // This will also write a range of Completed ticks between
    // the previous Value tick and the new one
    sendMessage = sourceStreamManager.updateSourceStream(msg, rollback);
        
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "updateSourceStream");
      
    return sendMessage;    
  }
79961
def broadcast(msg, *args)
      subscribers.each do |subscr|
        next unless subscr.respond_to?(msg) || subscr.respond_to?(:accept_all)

        subscr.send(msg, *args)
      end
    end
347411
@Override
    public void messageSent(final NextFilter nextFilter,
            final IoSession session, final WriteRequest writeRequest)
            throws Exception {
        if (writeRequest.getMessage() != null
                && writeRequest.getMessage() instanceof ProxyHandshakeIoBuffer) {
            // Ignore buffers used in handshaking
            return;
        }

        nextFilter.messageSent(session, writeRequest);
    }
11776
public void sendNotFlushedMessage(SIBUuid8 ignore, SIBUuid12 streamID, long requestID) 
  throws SIResourceException 
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(tc, "sendNotFlushedMessage", 
        new Object[]{ignore, streamID, new Long(requestID)});
        
    ControlNotFlushed notFlushed = createControlNotFlushed(_targetMEUuid, streamID, requestID);
    notFlushed = _internalOutputStreamManager.stampNotFlushed(notFlushed, streamID);
    
    // If the destination in a Link add Link specific properties to message
    if( _isLink )
    {
      notFlushed = (ControlNotFlushed)addLinkProps(notFlushed);
      notFlushed.setRoutingDestination(_routingDestination);
    }
    _mpio.sendToMe(_targetMEUuid, SIMPConstants.MSG_HIGH_PRIORITY, notFlushed);    
        
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "sendNotFlushedMessage");  
  }
1270403
public List<String> getSubscriptionList() throws SIResourceException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "getSubscriptionList");
        List<String> subscriptions = null;

        // Build up a list of subscriptions on the destination
        try
        {
            NonLockingCursor cursor =
                            _pubsubMessageItemStream.newNonLockingReferenceStreamCursor(
                                            new ClassEqualsFilter(
                                                            SubscriptionItemStream.class,
                                                            DurableSubscriptionItemStream.class));
            SubscriptionItemStream subscription =
                            (SubscriptionItemStream) cursor.next();

            while (subscription != null)
            {
                if (subscriptions == null)
                {
                    subscriptions = new LinkedList<String>();
                }
                subscriptions.add(
                                subscription
                                                .getConsumerDispatcher()
                                                .getConsumerDispatcherState()
                                                .getSubscriberID());
                subscription = (SubscriptionItemStream) cursor.next();
            }

            cursor.finished();
        } catch (MessageStoreException e)
        {
            FFDCFilter.processException(
                                        e,
                                        "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.getSubscriptionList",
                                        "1:2579:1.35.2.4",
                                        this);

            SibTr.exception(tc, e);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(tc, "getSubscriptionList", "SIResourceException");
            throw new SIResourceException(e);
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "getSubscriptionList", subscriptions);
        return subscriptions;
    }
1202062
private void addRemoterProxyMethods(TypeSpec.Builder classBuilder) {
        MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("registerProxyListener")
                .addModifiers(Modifier.PUBLIC)
                .returns(TypeName.VOID)
                .addParameter(ClassName.get(RemoterProxyListener.class), "listener")
                .addStatement("unRegisterProxyListener(null)")
                .addStatement("proxyListener = new DeathRecipient(listener)")
                .addStatement("linkToDeath(proxyListener)")
                .addAnnotation(Override.class);
        classBuilder.addMethod(methodBuilder.build());

        methodBuilder = MethodSpec.methodBuilder("unRegisterProxyListener")
                .addModifiers(Modifier.PUBLIC)
                .returns(TypeName.VOID)
                .addParameter(ClassName.get(RemoterProxyListener.class), "listener")
                .beginControlFlow("if(proxyListener != null)")
                .addStatement("unlinkToDeath(proxyListener)")
                .addStatement("proxyListener.proxyListener = null")
                .endControlFlow()
                .addStatement("proxyListener = null")
                .addAnnotation(Override.class);
        classBuilder.addMethod(methodBuilder.build());
    }
579116
private void createProxies() {
    source = createProxy(sourceType);
    destination = createProxy(destinationType);

    for (VisitedMapping mapping : visitedMappings) {
      createAccessorProxies(source, mapping.sourceAccessors);
      createAccessorProxies(destination, mapping.destinationAccessors);
    }
  }
1306832
public MessageId send(ProducerConnectionContext context, BasicMessage basicMessage) throws JMSException {
        return send(context, basicMessage, null);
    }