添加Channel

@param channelInfo
@param channelParameterInfo
@throws Exception
5979
public void doAdd(@FormGroup("dataMediaInfo") Group dataMediaInfo,
                      @FormField(name = "formDataMediaError", group = "dataMediaInfo") CustomErrors err, Navigator nav)
                                                                                                                       throws Exception {

        DataMedia dataMedia = new DataMedia();
        dataMediaInfo.setProperties(dataMedia);
        DataMediaSource dataMediaSource = dataMediaSourceService.findById(dataMediaInfo.getField("sourceId").getLongValue());
        if (dataMediaSource.getType().isMysql() || dataMediaSource.getType().isOracle()) {
            dataMedia.setSource((DbMediaSource) dataMediaSource);
        } else if (dataMediaSource.getType().isNapoli() || dataMediaSource.getType().isMq()) {
            dataMedia.setSource((MqMediaSource) dataMediaSource);
        }

        try {
            dataMediaService.create(dataMedia);
        } catch (RepeatConfigureException rce) {
            err.setMessage("invalidDataMedia");
            return;
        }

        nav.redirectTo(WebConstant.DATA_MEDIA_LIST_LINK);
    }
787487
@Override
  protected void initChannel(final Channel ch) throws Exception {
    ChannelPipeline pipeline = ch.pipeline();

    if (environment.sslEnabled()) {
      pipeline.addLast(new SslHandler(sslEngineFactory.get()));
    }
    if (LOGGER.isTraceEnabled()) {
      pipeline.addLast(new LoggingHandler(LogLevel.TRACE));
    }
    CredentialsProvider credentialsProvider = environment.credentialsProvider();
    Credentials credentials = credentialsProvider.get(address);
    pipeline
        .addLast(new HttpClientCodec())
        .addLast(new StartStreamHandler(bucket, credentials.getUsername(), credentials.getPassword()))
        .addLast(new ConfigHandler(configStream, currentBucketConfigRev, environment));
  }
1056223
public synchronized Channel findOrCreateChannel(ChannelData channelData) throws ChannelException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "findOrCreateChannel: " + channelData.getName());
        }
        String channelName = channelData.getName();
        Channel ret = this.existingChannels.get(channelName);
        if (ret == null) {
            // Create the new channel with the input configuration
            ret = createChannel(channelData);
            this.existingChannels.put(channelName, ret);
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "findOrCreateChannel");
        }
        return ret;
    }
1122039
@Process(actionType = AddAssignment.class)
    public void addAssignment(final AddAssignment action, final Channel channel) {
        Assignment assignment = action.getAssignment();
        internalAddAssignment(assignment, channel);
    }
868257
protected Channel createChannel(ChannelData config) throws ChannelException   
   {
      if (tc.isEntryEnabled()) SibTr.entry(this, tc, "createChannel", config);
      
      Channel retChannel;
      if (config.isInbound())
      {
         if (tc.isDebugEnabled()) SibTr.debug(this, tc, "createChannel", "inbound");
         try
         {
            Class clazz = Class.forName(JFapChannelConstants.INBOUND_CHANNEL_CLASS);
            Constructor contruct = clazz.getConstructor(new Class[] 
                                                        {
                                                           ChannelFactoryData.class, 
                                                           ChannelData.class 
                                                        });
            retChannel = (Channel) contruct.newInstance(new Object[] 
                                                        { 
                                                           channelFactoryData, 
                                                           config 
                                                        });
         }
         catch (Exception e)
         {
            FFDCFilter.processException(e, 
                                        "com.ibm.ws.sib.jfapchannel.impl.JFapChannelFactory.createChannel",  
                                        JFapChannelConstants.JFAPCHANNELFACT_CREATECHANNEL_01,
                                        this);
            
            if (tc.isDebugEnabled()) SibTr.debug(this, tc, "Unable to instantiate inbound channel", e);

            // Rethrow as a channel exception
            throw new ChannelException(e);
         }
      }
      else
      {
         retChannel = new JFapChannelOutbound(channelFactoryData, config);
      }
      
      if (tc.isEntryEnabled()) SibTr.exit(this, tc, "createChannel", retChannel);
      return retChannel;
   }
514513
public void start() throws ChannelException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(this, tc, "start; " + getName());
        }
        if (stoppedFlag) // only start once
        {
            stoppedFlag = false;
            if (getConfig().isInboundChannel()) {
                inboundNetworkLayer = new UDPNetworkLayer(this, workQueueManager, getConfig().getHostname(), getConfig().getPort());
                try {
                    inboundNetworkLayer.initDatagramSocket(null);
                } catch (IOException e) {
                    stoppedFlag = true;
                    throw new RetryableChannelException(e);
                }

                String IPvType = "IPv4";
                if (inboundNetworkLayer.getDatagramSocket().getInetAddress() instanceof Inet6Address) {
                    IPvType = "IPv6";
                }

                String hostname = getConfig().getHostname();
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(this, tc, "getHostname():  >" + hostname + "<");

                if ((hostname == null) || (hostname.equals("*"))) {
                    displayableHostName = "*  (" + IPvType + ")";
                } else {
                    InetAddress addr = inboundNetworkLayer.getDatagramSocket().getLocalAddress();
                    displayableHostName = addr.getHostName() + "  (" + IPvType + ": " + addr.getHostAddress() + ")";
                }
                Tr.info(tc, "CWUDP0001I", new Object[] { getConfig().getExternalName(), displayableHostName, String.valueOf(inboundNetworkLayer.getListenPort()) });
            }
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(this, tc, "start");
        }
    }
600840
@Override
	public void channelActive(final ChannelHandlerContext ctx) throws Exception {
		if (this.ctx == null) {
			this.ctx = ctx;
		}

		super.channelActive(ctx);
	}
682993
public void registerChannel(FileChannel channel, boolean writable) {
		readableChannels.add(channel);
		if (writable) {
			writableChannels.add(channel);
		}
	}
495450
private void migrateConfiguration(Channel channel) throws Exception {
    channel.setDefaultConsumer(delegate.getDefaultConsumer());
    if (flowBlocked)
      channel.flowBlocked();
    if (basicQos != null)
      basicQos.invoke(channel);
    if (confirmSelect)
      channel.confirmSelect();
    if (txSelect)
      channel.txSelect();
    synchronized (shutdownListeners) {
      for (ShutdownListener listener : shutdownListeners)
        channel.addShutdownListener(listener);
    }
    for (ConfirmListener listener : confirmListeners)
      channel.addConfirmListener(listener);
    for (FlowListener listener : flowListeners)
      channel.addFlowListener(listener);
    for (ReturnListener listener : returnListeners)
      channel.addReturnListener(listener);
  }
681665
function registerChannel(channel) {
  channels[channel.name] = channel;
  NativeBridge.registerChannel(channel.name, bridgeListener);
}
14990
protected void init(MuxServer server, int channel)
        throws IOException
    {
        this.server = server;
        this.channel = channel;

        this.url = null;

        chunkLength = 0;
    }
9082
public void parameterizeChannel(Channel channel) {
		if (this.ordering != null) {
			channel.setLocalStrategy(LocalStrategy.SORT, this.ordering.getInvolvedIndexes(), this.ordering.getFieldSortDirections());
		} else if (this.groupedFields != null) {
			boolean[] dirs = new boolean[this.groupedFields.size()];
			Arrays.fill(dirs, true);
			channel.setLocalStrategy(LocalStrategy.SORT, Utils.createOrderedFromSet(this.groupedFields), dirs);
		}
	}
700952
@Process(actionType = AddInMemoryRepository.class)
    public void addInMemoryRepository(final AddInMemoryRepository action, final Channel channel) {
        operationDelegate.onCreateResource(IN_MEMORY_REPOSITORY_ADDRESS,
                action.getProperty().getName(), action.getProperty().getValue(),
                new ChannelCallback(statementContext, channel));
    }
560797
public void addChannelToCache(Channel channel) {
        Channel oldChannel = channels.put(channel.getId(), channel);
        if (oldChannel != channel && oldChannel instanceof Cleanupable) {
            ((Cleanupable) oldChannel).cleanup();
        }
    }
193641
public void addChannel(
            T channel,
            String functionalityName,
            String requesterID,
            String conversationID)
    {
        T oldCh = null;
        synchronized (this.channelsWithId)
        {
            oldCh = this.channelsWithId.get(calculateId(functionalityName, requesterID, conversationID));
            this.channelsWithId.put(calculateId(functionalityName, requesterID, conversationID), channel);
        }
        synchronized (this.channelsWithFunctionalityName)
        {
            Collection<T> channelsForFunctionalityName = this.channelsWithFunctionalityName.get(functionalityName);
            if (null == channelsForFunctionalityName)
            {
                channelsForFunctionalityName = new ArrayList<T>();
            }
            // channels are stored in
            if (null != oldCh)
            {
                channelsForFunctionalityName.remove(oldCh);
            }
            channelsForFunctionalityName = this.removeInternalChannels(channelsForFunctionalityName);
            channelsForFunctionalityName.add(channel);
            this.channelsWithFunctionalityName.put(functionalityName, channelsForFunctionalityName);
        }
    }
152700
public ChannelTermination setup(ChannelData chanData, TCPChannelConfiguration oTCPChannelConfig, TCPChannelFactory _f) throws ChannelException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "setup");
        }
        super.setup(chanData, oTCPChannelConfig, _f);

        // try to load the AsyncLibrary. It will throw an exception if it can't load
        try {
            IAsyncProvider provider = AsyncLibrary.createInstance();

            if (getConfig().getAllocateBuffersDirect()) {
                jitSupportedByNative = provider.hasCapability(IAsyncProvider.CAP_JIT_BUFFERS);
            } else {
                jitSupportedByNative = false;
            }
        } catch (AsyncException ae) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "AioTCPChannel couldn't load native AIO library: " + ae.getMessage());
            }
            throw new ChannelException(ae);
        }

        if (!getConfig().isInbound()) {
            boolean startSelectors = false;
            if (wqm == null) {
                wqm = new AioWorkQueueManager();
                startSelectors = true;
            }
            super.connectionManager = new ConnectionManager(this, wqm);
            if (startSelectors) {
                wqm.startSelectors(false);
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "setup");
        }
        return this;
    }
378324
public static base_response add(nitro_service client, channel resource) throws Exception {
		channel addresource = new channel();
		addresource.id = resource.id;
		addresource.ifnum = resource.ifnum;
		addresource.state = resource.state;
		addresource.mode = resource.mode;
		addresource.conndistr = resource.conndistr;
		addresource.macdistr = resource.macdistr;
		addresource.lamac = resource.lamac;
		addresource.speed = resource.speed;
		addresource.flowctl = resource.flowctl;
		addresource.hamonitor = resource.hamonitor;
		addresource.tagall = resource.tagall;
		addresource.trunk = resource.trunk;
		addresource.ifalias = resource.ifalias;
		addresource.throughput = resource.throughput;
		addresource.bandwidthhigh = resource.bandwidthhigh;
		addresource.bandwidthnormal = resource.bandwidthnormal;
		return addresource.add_resource(client);
	}