예제 #1
0
파일: client.cpp 프로젝트: bjovke/ACE_TAO
  int svc (void)
  {
    for (int g = 0, i = 0; i < 100; i++)
      {
        try {
          group_svc.member_list (group_names[g]);
        }
        catch (PortableGroup::ObjectGroupNotFound) {
          }
        catch (CORBA::Exception &ex) {
          ACE_DEBUG ((LM_DEBUG,
                      ACE_TEXT ("Hammer thread %t caught %C accessing %C\n"),
                      ex._name(), group_names[g]));
        }
        if (group_names[++g] == 0)
          g = 0;
      }

    return 0;
  }
예제 #2
0
파일: nsgroup.cpp 프로젝트: asdlei00/ACE
int
NSGROUP::run_cmd(void)
{
  const int RC_ERROR   = -1;
  const int RC_BADARG  = -2;

  int rc = RC_ERROR;

  switch( parse_command_line () )
  {

    case NSGROUP_HELP:
      return show_usage ();
    break;

    case NSGROUP_GROUP_CREATE:
      rc = svc_.group_create ( group_arg(), policy_arg() );
    break;

    case NSGROUP_GROUP_BIND:
      rc = svc_.group_bind ( group_arg(), namepath_arg() );
    break;

    case NSGROUP_GROUP_UNBIND:
      rc = svc_.group_unbind ( namepath_arg() );
    break;

    case NSGROUP_GROUP_MODIFY:
      rc = svc_.group_modify ( group_arg(), policy_arg() );
    break;

    case NSGROUP_GROUP_LIST:
      rc = svc_.group_list ();
    break;

    case NSGROUP_GROUP_REMOVE:
      rc = svc_.group_remove ( group_arg() );
    break;

    case NSGROUP_MEMBER_LIST:
      rc = svc_.member_list ( group_arg() );
    break;

    case NSGROUP_MEMBER_ADD:
      rc = svc_.member_add ( group_arg(), location_arg(), ior_arg() );
    break;

    case NSGROUP_MEMBER_REMOVE:
      rc = svc_.member_remove ( group_arg(), location_arg() );
    break;

    case NSGROUP_MEMBER_SHOW:
      rc = svc_.member_show ( group_arg(), location_arg() );
    break;

    default:
      show_usage ();
      return rc;
    break;
  }

  if (rc == RC_BADARG)
  {
    show_usage ();
  }

  return rc;
}