In addition to setting MWS options using the rollover database, you can create user profiles that provide unique and customized connection information. User profiles prevent any log-in information from being either embedded in the client application or gathered at run time and transmitted to the host. User profiles also enable connection information to be maintained on the server, which allows for easy transition to other servers. In order to work with user profiles, you must:
To specify the name of the user profile file:
RocfORB.profiles.To create or edit profile information:
\install-directory\Java\SAS (where install-directory is the directory in which AppDev Studio was installed).To specify the use of a user profile on the client:
Select Tools
Register Connections from within webAF or Tools
AppDev Studio Connections from within webEIS.
Select an existing connection, and then click Edit.
In the Edit Connection window, select the Middleware tab.
Verify that the Use Middleware check box is selected.
Select the Use Profile check box.
Enter the name of a profile that is defined in your user profiles file in the Profile Name text field.
For example, if you have already created a user profile called solaris, then you might enter solaris. This would cause MWS to use the connection properties associated with the solaris user profile for all users of your application, applet, JavaServer Page, or servlet.
The following is an example user profile file:
# ROCFORB.profiles # Profile definitions for SAS Middleware Server # Global debug flags # debug.connection.logTrap=false; # debug.connection.traceProxyClient=false; # unix profile solaris.connection.propertyFileKey=debug solaris.connection.serverArchitecture=UNIX solaris.connection.host=solarisbox.mycompany.com solaris.connection.username=jsmith solaris.connection.password=pswrd solaris.connection.commandPrompt=$ solaris.connection.command=./runsas -dmr # production profile # production.connection.host=localhost # production.connection.funnelHost=somePC.mycompany.com
In the example above, two profiles currently exist: a UNIX profile called solaris and a production profile called production. Notice that the solaris profile is available for use; its lines are uncommented. To edit a profile, find the lines that correspond to the profile that you need to edit and change them. For example, you might need to change the username= and password= values for the solaris profile.
To add a simple user profile named MyProfile to this file, add the following lines of code:
# My local PC profile MyProfile.connection.serverArchitecture=PC MyProfile.connection.host=MyMachine
These lines simply state that you are connecting to a PC and that the host is called MyMachine.
MWS also enables the user to create a custom profile processor that can then verify user information against legacy systems or an LDAP server, for example. For more information, see Custom Profile Processors.
You can do more than specify a basic user profile by editing or adding to the lines of the user profile code listed in the RocfORB.profiles file. This section provides examples of what you can do to customize user profiles. Each example edits or builds upon the My local PC profile user profile that was added to the RocfORB.profiles file in the previous section.
MWS uses the SAS Connect Spawner in many instances. In order to use the SAS IOM Spawner, edit the serverArchitecture property value of a user profile.
To use the IOM Spawner:
Change the value of MyProfile.connection.serverArchitecture=PC to MyProfile.connection.serverArchitecture=IOM.
When you start MWS, select the SAS IOM Spawner instead of the SAS Connect Spawner. For more information on starting and stopping MWS, see Using Middleware Server.
Preloading classes can significantly reduce the amount of time that it takes your project to start. The class, such as an MDDB class, is loaded when MWS starts instead of when the client reaches the browser.
To preload a class using a user profile:
Add the line of code shown in bold below:
# My local PC profile MyProfile.connection.serverArchitecture=PC MyProfile.connection.host=localhost MyProfile.connection.initialClass=four-level class name
Stop and restart MWS so that your changes take effect.
To set a rollover server (or servers) within a user profile:
Add the line of code shown in bold below:
# My local PC profile MyProfile.connection.serverArchitecture=PC MyProfile.connection.host=localhost MyProfile.serverRollover=machineA, machineB
The new line of code states that when all SAS sessions on the server localhost are used, then SAS sessions on the machine named machineA should be used. When machineA is full, SAS sessions should rollover to machineB. Note that the machine defined by host= and all machines in the serverRollover= option must share the same server architecture.
To set rollover server options for any new rollover server that you set:
Open the funnel.cfg file. This file can typically be found at the following path: \install-directory\Java\SAS (where install-directory is the directory in which AppDev Studio was installed).
Locate the lines of code that correspond to the machines (hosts) that have been enabled:
# syntax is: # serveraddress=<number of SAS sessions>/<number of clients> localhost=1/1 machineA=1/1 machineB=1/*
Modify the code for each machine as needed. The current code has localhost handling one SAS session with one client before rolling over to machineA. machineA is configured the same way; machineB is configured to handle one SAS session with an infinite number of clients. This may not be ideal, as client requests could slow due to queuing.
(Optional) If you would like to view the status of your settings, see Viewing MWS Status in Using Middleware Server.
Preloading SAS sessions before you need to use them saves time when your application, applet, JavaServer Page, or servlet needs to connect to data using MWS. You can use the RocfORB.profiles file to specify preloading information.
To preload SAS sessions through a user profile:
Open the RocfORB.profiles file.
Locate the lines of code that begin with #Preload SAS Sessions.
Set the following lines of code for the SAS session that you want to preload:
preload1.profile=profilename preload1.asynchronousStartup=false preload1.autoRestart=true preload1.preloadedClients=2 preload1.retain=false
The following table describes each of the preloaded properties:
| Preload Property | Description | Value Information |
|---|---|---|
profile |
specifies the name of the profile that you want to preload. | appropriate profile name |
asynchronousStartup |
determines whether all SAS sessions should be started at once (True) or not (False). | true or false |
autoRestart |
indicates whether the connection should be used by one client only and, if used, should then be discarded and another connection created in its place. See Terminating Preloaded SAS Sessions Abruptly when autoRestart=true for more details. |
true or false |
preloadedClients |
specifies the number of client spaces that you would like to make available at start up. Having at least two spaces means that two clients can connect without requiring any startup time. | a numeric value |
retain |
If true, then all preloaded SAS sessions are retained for further clients. That is, when a preloaded client is released, another preloaded client space is created in the same SAS session for future use. If false, then preloaded SAS sessions are not retained after a preloaded client has been used. If another client is needed, then a new SAS session is started and the client is placed in the new session. |
true or false |
Set the appropriate properties for any other SAS sessions that you want to preload. Note that the prefix for the lines of code for any preload must be unique. In the example above, the prefix preload1 was used. Therefore, you might use preload2 as the prefix for the next preload.
Stop and restart MWS in order to have your new properties take effect.
(Optional) If you would like to view the status of your settings, see Viewing MWS Status in Using Middleware Server.
autoRestart=trueAn abrupt termination of a preloaded SAS session occurs when
An unexpected SAS server shutdown might occur if
If a preloaded SAS session is abruptly terminated when the autoRestart preload property is set to true, MWS does not automatically restart the preloaded SAS session instantly. Instead, SAS and any preloaded SAS sessions are queued to restart when the next SAS session is requested.
To request the next SAS session, connect to data from a webAF or a webEIS client. All the preloaded SAS sessions will reappear and any old SAS sessions will be removed.
Note: There are a number of ways in which you can cleanly terminate preloaded SAS sessions, including the following examples:
To shut down MWS and clean up any related settings, issue the following line:
java com.sas.rmi.RocfORBManager -shutdown
To shut down MWS, clean up any related settings, and then restart MWS, issue the following line:
java com.sas.rmi.RocfORBManager -reload