The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Tuxedo::Admin::Server

SYNOPSIS

  use Tuxedo::Admin;

  $admin = new Tuxedo::Admin;

  $server = $admin->server('GW_GRP_1','30');

  print $server->servername(), "\t", 
        $server->srvgrp(), "\t",
        $server->numreq(), "\n";

  $rc = $server->shutdown() 
    if ($server->exists() and ($server->state() ne 'INACTIVE'));
  unless ($rc < 0)
  {
    $server->max('10');
    $server->update();
    $server->boot();
  }

DESCRIPTION

Provides methods to query, add, remove and update a specific Tuxedo server instance.

INITIALISATION

Tuxedo::Admin::Server objects are not instantiated directly. Instead they are created via the server() method of a Tuxedo::Admin object.

Example:

  $server = $admin->server('GW_GRP_1','30');

This applies both for existing servers and for new servers that are being created.

METHODS

exists()

Used to determine whether or not the server exists in the current Tuxedo application.

  if ($server->exists())
  {
    ...
  }

Returns true if the server exists.

add()

Adds the server to the current Tuxedo application.

  $rc = $server->add();

Croaks if the server already exists or if the required srvid, srvgrp and servername parameters are not set. $rc is non-negative on success.

Example:

  $server = $admin->server('GW_GRP_1','30');
  die "Server already exists\n" if $server->exists();
  
  $server->servername('GWTDOMAIN');
  $server->min('1');
  $server->max('1');
  $server->grace('0');
  $server->maxgen('5');
  $server->restart('Y');
  
  $rc = $server->add($server);
  print "Welcome!" unless ($rc < 0);
  
  $admin->print_status();
  

remove()

Removes the server from the current Tuxedo application.

  $rc = $server->remove();

Croaks if the server is booted or if the required srvid, srvgrp and servername parameters are not set. $rc is non-negative on success.

Example:

  $server = $admin->server('GW_GRP_1','30');
  
  warn "Can't remove a server while it is booted.\n"
    unless ($server->state() eq 'INACTIVE');
  
  $rc = $server->remove()
    if ($server->exists() and ($server->state() eq 'INACTIVE'));

  print "hasta la vista baby!" unless ($rc < 0);
  
  $admin->print_status();
  

update()

Updates the server configuration in the current Tuxedo application with the values of the current object.

  $rc = $server->update();

Croaks if the server does not exist or the required srvid and srvgrp parameters are not set. $rc is non-negative on success.

Example:

  $server = $admin->server('GW_GRP_1', '30');
  die "Can't find server\n" unless $server->exists();

  $server->grace('0')
  $server->restart('Y');
  
  $rc = $server->update();

  $admin->print_status(*STDERR);
  

boot()

Starts the server.

  $rc = $server->boot();

Croaks if the server is already booted. $rc is non-negative on success.

Example:

  $server = $admin->server('GW_GRP_1','30');
  $rc = $server->boot()
    if ($server->exists() and ($server->state() ne 'ACTIVE'));
  

shutdown()

Stops the server.

  $rc = $server->shutdown();

Croaks if the server is not running. $rc is non-negative on success.

Example:

  $server = $admin->server('GW_GRP_1','30');
  $rc = $server->shutdown() 
    if ($server->exists() and ($server->state() ne 'INACTIVE'));
  

services()

Returns the list of services advertised by this server.

  @services = $server->services();

where @services is an array of references to Tuxedo::Admin::Service objects.

Example:

  print "Server: ", $server->servername(), " advertises:\n";
  foreach $service ($server->services())
  {
    print "\t", $service->servicename(), "\n";
  }

get/set methods

The following methods are available to get and set the server parameters. If an argument is provided then the parameter value is set to be the argument value. The value of the parameter is returned.

Example:

  # Get the server name
  print $server->servername(), "\n";

  # Set the server name
  $server->servername('GWTDOMAIN');
basesrvid()
clopt()
cltlmid()
cltpid()
cltreply()
cmtret()
conv()
curconv()
curdispatchthreads()
curinterface()
curobjects()
curreq()
currservice()
curtime()
ejbcache_flush()
envfile()
generation()
grace()
grpno()
hwdispatchthreads()
lastgrp()
lmid()
max()
maxdispatchthreads()
maxejbcache()
maxgen()
maxqueuelen()
min()
mindispatchthreads()
numconv()
numdequeue()
numdispatchthreads()
numenqueue()
numpost()
numreq()
numsubscribe()
numtran()
numtranabt()
numtrancmt()
pid()
rcmd()
replyq()
restart()
rpid()
rpperm()
rqaddr()
rqid()
rqperm()
sec_principal_location()
sec_principal_name()
sec_principal_passvar()
sequence()
servername()
sicacheentriesmax()
srvgrp()
srvid()
srvtype()
state()
svctimeout()
system_access()
threadstacksize()
timeleft()
timerestart()
timestart()
totreqc()
totworkl()
tranlev()