Resolve the channel by name.
@param channelName the name to resolve
@return the MessageChannel object
423860
protected MessageChannel resolveChannelName(String channelName) {
        if (channelResolver == null) {
            channelResolver = new BeanFactoryChannelResolver(beanFactory);
        }
        
        return channelResolver.resolveDestination(channelName);
    }
50924
public synchronized void resolveClientObject (
        final Name username, final ClientResolutionListener listener)
    {
        // look to see if the client object is already resolved
        final ClientObject clobj = _objmap.get(username);
        if (clobj != null) {
            // report that the client is resolved on the dobjmgr thread to provide equivalent
            // behavior to the case where we actually have to do the resolution
            clobj.reference();
            _omgr.postRunnable(new Runnable() {
                public void run () {
                    listener.clientResolved(username, clobj);
                }
            });
            return;
        }

        // look to see if it's currently being resolved
        ClientResolver clr = _penders.get(username);
        if (clr != null) {
            // throw this guy onto the bandwagon
            clr.addResolutionListener(listener);
            return;
        }

        // figure out our client resolver class
        Class<? extends ClientResolver> resolverClass = null;
        for (SessionFactory factory : _factories) {
            if ((resolverClass = factory.getClientResolverClass(username)) != null) {
                break;
            }
        }

        try {
            // create a client resolver instance which will create our client object, populate it
            // and notify the listeners
            clr = _injector.getInstance(resolverClass);
            clr.init(username);
            clr.addResolutionListener(this);
            clr.addResolutionListener(listener);
            _penders.put(username, clr);

            // create and register our client object and give it back to the client resolver; we
            // need to do this on the dobjmgr thread since we're registering an object
            final ClientResolver fclr = clr;
            _omgr.postRunnable(new Runnable() {
                public void run () {
                    ClientObject clobj = fclr.createClientObject();
                    clobj.setLocal(ClientLocal.class, fclr.createLocalAttribute());
                    fclr.objectAvailable(_omgr.registerObject(clobj));
                }
            });

        } catch (Exception e) {
            // let the listener know that we're hosed
            listener.resolutionFailed(username, e);
        }
    }
348376
static Class<?> resolveParameterName(String parameterName, Class<?> target) {
    Map<Type, Type> typeVariableMap = getTypeVariableMap(target);
    Set<Entry<Type, Type>> set = typeVariableMap.entrySet();
    Type type = Object.class;

    for (Entry<Type, Type> entry : set) {
      if (entry.getKey().toString().equals(parameterName)) {
        type = entry.getKey();
        break;
      }
    }
    return resolveType(type, typeVariableMap);
  }
1181448
function channel(name) {
    if (0 === arguments.length) {
        if (!this._channel) this._channel = postal.channel();
        return this._channel;
    } else {
        this._channel = postal.channel(name);
    }
    return this;
}
962450
protected ChannelsModel toChannelsModel(Channel[] channelAnnotations, KnowledgeNamespace knowledgeNamespace, ComponentModel componentModel,
                                            SwitchYardNamespace switchyardNamespace) {
        if (channelAnnotations == null || channelAnnotations.length == 0) {
            return null;
        }
        ChannelsModel channelsModel = new V1ChannelsModel(knowledgeNamespace.uri());
        for (Channel channelAnnotation : channelAnnotations) {
            ChannelModel channelModel = new V1ChannelModel(knowledgeNamespace.uri());
            Class<? extends org.kie.api.runtime.Channel> clazz = channelAnnotation.value();
            if (Channel.UndefinedChannel.class.isAssignableFrom(clazz)) {
                clazz = SwitchYardServiceChannel.class;
            }
            channelModel.setClazz(clazz);
            String name = channelAnnotation.name();
            if (UNDEFINED.equals(name)) {
                if (SwitchYardServiceChannel.class.isAssignableFrom(clazz)) {
                    name = SwitchYardServiceChannel.SERVICE;
                }
            }
            if (UNDEFINED.equals(name)) {
                name = clazz.getSimpleName();
            }
            channelModel.setName(name);
            String operation = channelAnnotation.operation();
            if (!UNDEFINED.equals(operation)) {
                channelModel.setOperation(operation);
            }
            String reference = channelAnnotation.reference();
            if (!UNDEFINED.equals(reference)) {
                channelModel.setReference(reference);
                ComponentReferenceModel componentReferenceModel = new V1ComponentReferenceModel(switchyardNamespace.uri());
                componentReferenceModel.setName(reference);
                Class<?> interfaze = channelAnnotation.interfaze();
                if (!Channel.UndefinedInterface.class.isAssignableFrom(interfaze)) {
                    InterfaceModel interfaceModel = new V1InterfaceModel(InterfaceModel.JAVA);
                    interfaceModel.setInterface(interfaze.getName());
                    componentReferenceModel.setInterface(interfaceModel);
                    componentModel.addReference(componentReferenceModel);
                }
            }
            channelsModel.addChannel(channelModel);
        }
        return channelsModel;
    }
924712
private String resolveName(String localName, String qualifiedName) {

        if ((localName == null) || (localName.length() == 0)) {
            return qualifiedName;
        } else {
            return localName;
        }
    }
1360369
protected Channel provideChannel() throws IOException {
        if (channel == null || !channel.isOpen()) {
            Connection connection = connectionFactory.newConnection();
            channel = connection.createChannel();
        }
        return channel;
    }
1282054
public MessageArg get(String name) {
    return map == null ? null : map.get(name);
  }
314609
public B message(String messageName) {
    MessageEventDefinition messageEventDefinition = createMessageEventDefinition(messageName);
    element.getEventDefinitions().add(messageEventDefinition);

    return myself;
  }
296032
public static String getRemoteAddress(Channel channel) {
    if (channel != null && channel.remoteAddress() != null) {
      return channel.remoteAddress().toString();
    }
    return "<unknown remote>";
  }
1348593
public static String getChannelByChannelId(Long channelId) {
        // 根据channelId 构造path
        return MessageFormat.format(ArbitrateConstants.NODE_CHANNEL_FORMAT, String.valueOf(channelId));
    }
191081
@CheckForNull
    public final VirtualChannel getChannel() {
        Computer c = toComputer();
        return c==null ? null : c.getChannel();
    }
33228
@FFDCIgnore({ NamingException.class })
    @Sensitive
    Object resolveObject(Object o, WSName subname) throws NamingException {
        ServiceReference<?> ref = null;
        try {
            if (o instanceof ContextNode)
                return new WSContext(userContext, (ContextNode) o, env);

            if (tc.isDebugEnabled())
                Tr.debug(tc, "Resolving object", o);

            if (o instanceof ServiceReference) {
                ref = (ServiceReference<?>) o;
                if (tc.isDebugEnabled())
                    Tr.debug(tc, "External service registry entry.");
            } else if (o instanceof AutoBindNode) {
                if (tc.isDebugEnabled())
                    Tr.debug(tc, "AutoBindNode entry.");
                AutoBindNode abNode = (AutoBindNode) o;
                ref = (ServiceReference<?>) abNode.getLastEntry();
                // null means the node was removed in another thread.
                if (ref == null) {
                    // Use the same semantics as ContextNode.lookup.
                    throw new NameNotFoundException(subname.toString());
                }
            } else if (o instanceof ServiceRegistration) {
                ref = ((ServiceRegistration<?>) o).getReference();
                if (tc.isDebugEnabled())
                    Tr.debug(tc, "Programmatic JNDI entry.");
            }

            boolean getObjectInstance;
            if (ref == null) {
                getObjectInstance = true;
            } else {
                o = getReference(userContext, ref);
                if (o == null) {
                    throw new NamingException(Tr.formatMessage(tc, "jndi.servicereference.failed", subname.toString()));
                }

                Object origin = ref.getProperty(JNDIServiceBinder.OSGI_JNDI_SERVICE_ORIGIN);
                if (tc.isDebugEnabled())
                    Tr.debug(tc, "Retrieved service from registry", o,
                             JNDIServiceBinder.OSGI_JNDI_SERVICE_ORIGIN + "=" + origin,
                             Constants.OBJECTCLASS + "=" + Arrays.toString((String[]) ref.getProperty(Constants.OBJECTCLASS)));
                getObjectInstance = JNDIServiceBinder.OSGI_JNDI_SERVICE_ORIGIN_VALUE.equals(origin) ||
                                    contains((String[]) ref.getProperty(Constants.OBJECTCLASS), Reference.class.getName());
            }

            if (getObjectInstance) {
                // give JNDI a chance to resolve any references
                try {
                    Object oldO = o;
                    o = NamingManager.getObjectInstance(o, subname, this, env);
                    if (o != oldO)
                        if (tc.isDebugEnabled())
                            Tr.debug(tc, "Resolved object through NamingManager"); // remove logging object o since it might contain the sensitive information.
                } catch (NamingException e) {
                    throw e;
                } catch (Exception e) {
                    // FFDC and proceed
                }
            }
            return o;
        } catch (NamingException e) {
            throw e;
        } catch (Exception e) {
            NamingException ne = new NamingException();
            ne.setRootCause(e);
            throw ne;
        }
    }
1081120
protected Channel createChannel() throws IOException {
        LOGGER.debug("Creating channel");
        Connection connection = connectionFactory.newConnection();
        Channel channel = connection.createChannel();
        LOGGER.debug("Created channel");
        return channel;
    }
632180
public function resolve($messageName)
    {
        if (!isset($this->classMap[$messageName])) {
            throw new \RuntimeException(
                sprintf(
                    'Could not resolve class for message %s. Did you forgot to register it?',
                    $messageName
                )
            );
        }

        return $this->classMap[$messageName];
    }
1226347
def get_channel(self, name):
        
        r = self.kraken_request('GET', 'channels/' + name)
        return models.Channel.wrap_get_channel(r)
790512
public String getVariable(final Channel channel, final String variableName)
    {
        String value = "";
        final GetVarAction var = new GetVarAction(channel, variableName);

        try
        {
            PBX pbx = PBXFactory.getActivePBX();
            if (!pbx.waitForChannelToQuiescent(channel, 3000))
                throw new PBXException("Channel: " + channel + " cannot be retrieved as it is still in transition.");

            ManagerResponse convertedResponse = sendAction(var, 500);
            if (convertedResponse != null)
            {
                value = convertedResponse.getAttribute("value"); //$NON-NLS-1$
                if (value == null)
                    value = "";
                CoherentManagerConnection.logger.debug("getVarAction returned name:" + variableName + " value:" + value); //$NON-NLS-1$ //$NON-NLS-2$
            }
        }
        catch (final Exception e)
        {
            CoherentManagerConnection.logger.debug(e, e);
            CoherentManagerConnection.logger.error("getVariable: " + e); //$NON-NLS-1$
        }
        return value;
    }