Programming Guide



advertise

Advertises services offered by a server to a client

Synopsis

advertise {ALL | SERVICE serviceName | GROUP serviceGroup}

Arguments

ALL
Advertise all services defined in the JIF.

SERVICE serviceName
Advertise a service that is defined in the JIF, where serviceName can be up to 15 characters long. The JIF is consulted to validate the service name.

GROUP serviceGroup
Advertise all services belonging to the named group, as defined in the JIF, where serviceGroup can be up to 31 characters long.

Environment

JetNet, Oracle Tuxedo

Scope

Server

Description

The advertise command reads the specified services from the JIF and advertises them to clients. If a service is already advertised, its JIF definition is reread and the service is readvertised. This might occur during development or maintenance when a server is reinitialized after a JIF entry is updated or corrected. If successful, advertise sets the tp_return property to the number of services advertised.

You can advertise individual services, all services in a group, or all services. For example, the following code advertises service transfer:

advertise SERVICE "transfer"

This code advertises all services in the emp_account group:

advertise GROUP "emp_account"

The next example advertises all services and logs a message:

proc adv_and_log
vars message
advertise ALL
message = @app()->tp_return##" services advertised."
log message

Exceptions

Execution of advertise can raise the following exceptions:

Exception Severity Cause
TP_GROUP_NOT_IN_JIF
TP_COMMAND

Group cannot be found in the JIF.

TP_IDENTIFIER_TRUNCATED
TP_WARNING

Service name exceeded 15 characters.

TP_MONITOR_ERROR
TP_ERROR

An error was reported by the middleware.

TP_NO_SERVICES_ADVERTISED
TP_WARNING

ALL was specified and there are no services in the JIF, or GROUP was specified and the group is empty.

TP_SERVICE_NOT_IN_JIF
TP_COMMAND

Service cannot be found in the JIF.

TP_SVC_ADVERTISE_LIMIT
TP_COMMAND

The limit on number of advertised services has been reached.

See Also

unadvertise