当前位置: 首页>>代码示例>>Java>>正文


Java TaggedComponent类代码示例

本文整理汇总了Java中org.omg.IOP.TaggedComponent的典型用法代码示例。如果您正苦于以下问题:Java TaggedComponent类的具体用法?Java TaggedComponent怎么用?Java TaggedComponent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TaggedComponent类属于org.omg.IOP包,在下文中一共展示了TaggedComponent类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addIORComponentToProfileInternal

import org.omg.IOP.TaggedComponent; //导入依赖的package包/类
/**
 * Internal utility method to add an IOR component to the set of profiles
 * present in the iterator.
 */
private void addIORComponentToProfileInternal(
    TaggedComponent tagged_component, Iterator iterator )
{
    // Convert the given IOP::TaggedComponent into the appropriate
    // type for the TaggedProfileTemplate
    TaggedComponentFactoryFinder finder =
        orb.getTaggedComponentFactoryFinder();
    Object newTaggedComponent = finder.create( orb, tagged_component );

    // Iterate through TaggedProfileTemplates and add the given tagged
    // component to the appropriate one(s).
    boolean found = false;
    while( iterator.hasNext() ) {
        found = true;
        TaggedProfileTemplate taggedProfileTemplate =
            (TaggedProfileTemplate)iterator.next();
        taggedProfileTemplate.add( newTaggedComponent );
    }

    // If no profile was found with the given id, throw a BAD_PARAM:
    // (See orbos/00-08-06, section 21.5.3.3.)
    if( !found ) {
        throw omgWrapper.invalidProfileId() ;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:IORInfoImpl.java

示例2: add_ior_component_to_profile

import org.omg.IOP.TaggedComponent; //导入依赖的package包/类
/**
 * Adds a service-specific component to the IOR profile.
 *
 * @param tagged_component a tagged component being added.
 *
 * @param profile_id the IOR profile to that the component must be added. The
 * 0 value ({@link org.omg.IOP.TAG_INTERNET_IOP#value}) adds to the Internet
 * profile where host and port are stored by default.
 */
public void add_ior_component_to_profile(TaggedComponent tagged_component,
                                         int profile_id)
{
  if (profile_id == TAG_INTERNET_IOP.value)
    // Add to the Internet profile
    Internet.components.add(tagged_component);
  else
    {
      // Add to others.
      for (int i = 0; i < profiles.size(); i++)
        {
          TaggedProfile profile = (TaggedProfile) profiles.get(i);
          if (profile.tag == profile_id)
            addComponentTo(profile, tagged_component);
        }
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:27,代码来源:IOR.java

示例3: createSSLTaggedComponent

import org.omg.IOP.TaggedComponent; //导入依赖的package包/类
private void createSSLTaggedComponent(IIOPProfileTemplate profileTemplate, int port) throws UserException
{
    SSL ssl = new SSL();
    ssl.port = (short) port;

    short sslOptions = Integrity.value | Confidentiality.value | DetectMisordering.value | DetectReplay.value
            | EstablishTrustInTarget.value | EstablishTrustInClient.value;
    ssl.target_supports = sslOptions;
    ssl.target_requires = sslOptions;

    GIOPVersion giopVersion = orb.getORBData().getGIOPVersion();
    CDREncapsCodec codec = new CDREncapsCodec(orb, giopVersion.getMajor(),giopVersion.getMinor());

    Any any = orb.create_any();
    SSLHelper.insert(any, ssl);
    byte[] componentData = codec.encode_value(any);

    TaggedComponent sslTaggedComponent = new TaggedComponent(TAG_SSL_SEC_TRANS.value, componentData);

    TaggedComponentFactoryFinder finder =
            orb.getTaggedComponentFactoryFinder();
    Object newTaggedComponent = finder.create( orb, sslTaggedComponent);

    profileTemplate.add(newTaggedComponent);
}
 
开发者ID:jboss,项目名称:openjdk-orb,代码行数:26,代码来源:INSURLOperationImpl.java

示例4: add_ior_component

import org.omg.IOP.TaggedComponent; //导入依赖的package包/类
/**
 * Adds a service-specific component to the IOR profile. The specified
 * component will be included in all profiles, present in the IOR.
 *
 * @param tagged_component a tagged component being added.
 */
public void add_ior_component(TaggedComponent tagged_component)
{
  // Add to the Internet profile.
  Internet.components.add(tagged_component);

  // Add to others.
  for (int i = 0; i < profiles.size(); i++)
    {
      TaggedProfile profile = (TaggedProfile) profiles.get(i);
      addComponentTo(profile, tagged_component);
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:19,代码来源:IOR.java

示例5: add_ior_component_to_profile

import org.omg.IOP.TaggedComponent; //导入依赖的package包/类
/**
 * Add component to tje specified profile of this IOR.
 */
public void add_ior_component_to_profile(TaggedComponent tagged_component,
  int profile_id
)
{
  ior.add_ior_component_to_profile(tagged_component, profile_id);
}
 
开发者ID:vilie,项目名称:javify,代码行数:10,代码来源:gnuIorInfo.java

示例6: get_effective_component

import org.omg.IOP.TaggedComponent; //导入依赖的package包/类
/**
 * Get effective component with the give id from the Internet profile.
 */
public TaggedComponent get_effective_component(int id)
  throws BAD_PARAM
{
  if (id == TAG_CODE_SETS.value)
    {
      // Codesets are encoded separately.
      BufferedCdrOutput buf = new BufferedCdrOutput(512);
      buf.setOrb(orb);
      ior.Internet.CodeSets.write(buf);

      TaggedComponent t = new TaggedComponent();
      t.tag = TAG_CODE_SETS.value;
      t.component_data = buf.buffer.toByteArray();
      return t;
    }
  else
    {
      for (int i = 0; i < ior.Internet.components.size(); i++)
        {
          TaggedComponent c =
            (TaggedComponent) ior.Internet.components.get(i);
          if (c.tag == id)
            return c;
        }
    }
  throw new BAD_PARAM("No component " + id + " in the Internet profile", 28,
    CompletionStatus.COMPLETED_MAYBE
  );
}
 
开发者ID:vilie,项目名称:javify,代码行数:33,代码来源:gnuRequest.java

示例7: get_effective_components

import org.omg.IOP.TaggedComponent; //导入依赖的package包/类
/**
 * Get all components with the given id from the internet profile.
 */
public TaggedComponent[] get_effective_components(int id)
  throws BAD_PARAM
{
  if (id == TAG_CODE_SETS.value)
    return new TaggedComponent[] { get_effective_component(TAG_CODE_SETS.value) };
  else
    {
      ArrayList components = new ArrayList(ior.Internet.components.size());
      for (int i = 0; i < ior.Internet.components.size(); i++)
        {
          TaggedComponent c =
            (TaggedComponent) ior.Internet.components.get(i);
          if (c.tag == id)
            components.add(c);
        }
      if (components.size() == 0)
        throw new BAD_PARAM("No component " + id +
          " in the Internet profile", 28, CompletionStatus.COMPLETED_MAYBE
        );
      else
        {
          TaggedComponent[] t = new TaggedComponent[ components.size() ];
          for (int i = 0; i < t.length; i++)
            t [ i ] = (TaggedComponent) components.get(i);
          return t;
        }
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:32,代码来源:gnuRequest.java

示例8: get_effective_components

import org.omg.IOP.TaggedComponent; //导入依赖的package包/类
/**
 * Returns all the tagged components with the given ID from the profile
 * selected for this request.
 */
public TaggedComponent[] get_effective_components (int id){
    checkAccess( MID_GET_EFFECTIVE_COMPONENTS );
    Integer integerId = new Integer( id );
    TaggedComponent[] result = null;
    boolean justCreatedCache = false;

    if( cachedEffectiveComponents == null ) {
        cachedEffectiveComponents = new HashMap();
        justCreatedCache = true;
    }
    else {
        // Look in cache:
        result = (TaggedComponent[])cachedEffectiveComponents.get(
            integerId );
    }

    // null could mean we cached null or not in cache.
    if( (result == null) &&
        (justCreatedCache ||
        !cachedEffectiveComponents.containsKey( integerId ) ) )
    {
        // Not in cache.  Get it from the profile:
        CorbaContactInfo corbaContactInfo = (CorbaContactInfo)
            messageMediator.getContactInfo();
        IIOPProfileTemplate ptemp =
            (IIOPProfileTemplate)corbaContactInfo.getEffectiveProfile().
            getTaggedProfileTemplate();
        result = ptemp.getIOPComponents(myORB, id);
        cachedEffectiveComponents.put( integerId, result );
    }

    // As per ptc/00-08-06, section 21.3.13.6., If not found, raise
    // BAD_PARAM with minor code INVALID_COMPONENT_ID.
    if( (result == null) || (result.length == 0) ) {
        throw stdWrapper.invalidComponentId( integerId ) ;
    }

    // Good citizen: In the interest of efficiency, we will assume
    // interceptors will not modify the returned TaggedCompoent[], or
    // the TaggedComponents inside of it.  Otherwise, we would need to
    // clone the array and make a deep copy of its contents.

    return result;
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:49,代码来源:ClientRequestInfoImpl.java

示例9: addComponentTo

import org.omg.IOP.TaggedComponent; //导入依赖的package包/类
/**
 * Add given component to the given profile that is NOT an Internet profile.
 *
 * @param profile the profile, where the component should be added.
 * @param component the component to add.
 */
private static void addComponentTo(TaggedProfile profile,
                                   TaggedComponent component)
{
  if (profile.tag == TAG_MULTIPLE_COMPONENTS.value)
    {
      TaggedComponent[] present;
      if (profile.profile_data.length > 0)
        {
          BufferredCdrInput in = new BufferredCdrInput(profile.profile_data);

          present = new TaggedComponent[in.read_long()];

          for (int i = 0; i < present.length; i++)
            {
              present[i] = TaggedComponentHelper.read(in);
            }
        }
      else
        present = new TaggedComponent[0];

      BufferedCdrOutput out = new BufferedCdrOutput(profile.profile_data.length
                                          + component.component_data.length
                                          + 8);

      // Write new amount of components.
      out.write_long(present.length + 1);

      // Write other components.
      for (int i = 0; i < present.length; i++)
        TaggedComponentHelper.write(out, present[i]);

      // Write the passed component.
      TaggedComponentHelper.write(out, component);

      try
        {
          out.close();
        }
      catch (IOException e)
        {
          throw new Unexpected(e);
        }
      profile.profile_data = out.buffer.toByteArray();
    }
  else
    // The future supported tagged profiles should be added here.
    throw new BAD_PARAM("Unsupported profile type " + profile.tag);
}
 
开发者ID:vilie,项目名称:javify,代码行数:55,代码来源:IOR.java

示例10: get_effective_component

import org.omg.IOP.TaggedComponent; //导入依赖的package包/类
/** @inheritDoc */
public TaggedComponent get_effective_component(int id)
  throws BAD_PARAM
{
  return request.get_effective_component(id);
}
 
开发者ID:vilie,项目名称:javify,代码行数:7,代码来源:gnuClientRequestInfo.java

示例11: get_effective_components

import org.omg.IOP.TaggedComponent; //导入依赖的package包/类
/** @inheritDoc */
public TaggedComponent[] get_effective_components(int id)
  throws BAD_PARAM
{
  return request.get_effective_components(id);
}
 
开发者ID:vilie,项目名称:javify,代码行数:7,代码来源:gnuClientRequestInfo.java

示例12: add_ior_component

import org.omg.IOP.TaggedComponent; //导入依赖的package包/类
/**
 * Add component to all found profiles in this IOR.
 */
public void add_ior_component(TaggedComponent tagged_component)
{
  ior.add_ior_component(tagged_component);
}
 
开发者ID:vilie,项目名称:javify,代码行数:8,代码来源:gnuIorInfo.java


注:本文中的org.omg.IOP.TaggedComponent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。