RPC HELP TSharedRPCBroker

From VistApedia
Revision as of 17:24, 8 July 2015 by Kdtop (talk | contribs)
Jump to: navigation, search

RPC Broker Help Home

TSharedRPCBroker Component

Properties

Example

Parent Class<h3> TSharedRPCBroker = class(TComponent) <h3>Unit

 TRPCB Unit

Description

The TSharedRPCBroker component is derived from the existing TRPCBroker component. The TSharedRPCBroker component provides applications or plug-ins to applications easy access to an RPCBroker without the need for a separate M partition. Each component has its own security (i.e., option) as well. The default value of the AllowShared is True. If an application will have RPCs that require extensive time, it would be best to NOT share a Broker instance and the AllowShared should then be set to False.

For its functionality, the TSharedRPCBroker component uses the RPCSharedBrokerSessionMgr.EXE, which is an out of process Common Object Module (COM) component. This executable handles the actual Broker connections and communication, permitting multiple applications to use a single connection and partition to the VistA M Server. However, it also handles connections of different applications to different Server/Port combinations and can handle multiple connections to a specific Server/Port combination, if an application sets AllowShared to False.

Like the TRPCBroker, the TSharedRPCBroker component and RPCSharedBrokerSessionMgr executable provide VistA application developers with all of the client/server-related functionality in one integrated component. Using the TSharedRPCBroker component, an application can connect to the VistA M Server by simply setting the Connected property to True. Remote procedures on the server can be executed by preparing the Param and RemoteProcedure properties and invoking either the Example, Example or Example methods.

Using the TSharedRPCBroker Component

To use the TSharedRPCBroker component in place of the TRPCBroker component with an existing application, do the following:

  1. Open the application.
  2. Notate the current name assigned to the TRPCBroker component.
  3. Remove the TRPCBroker component.
  4. Add the TSharedRPCBroker component and give it the same name that was used for the TRPCBroker component (see Step #2).
  5. If you do not have any other components (e.g., FileMan Delphi Components) that reference the original TRPCBroker component (see Step #2), simply recompile and run the application. Otherwise, proceed to Step #6.
  6. If you have components (e.g., FMLister, FMGets, etc.) that reference the original TRPCBroker component, do the following:
    • Click on the component(s).
    • Select the new TSharedRPCBroker component at the TRPCBroker reference for this component in the object inspector. The assignment isn't by name but to the actual component instance or location in memory at the time, and this has to be reset.
    • Repeat Steps #6a-6b for each additional component
    • Recompile and run the application.

NOTE: Application developers must remember to include the RPCSharedBrokerSessionMGR.EXE when building their applications.

When the first application connects, you will see an instance of the RPCSharedBrokerSessionMgr appear in the taskbar. All Broker connections via the TSharedRPCBroker component are routed through this executable.

NOTE: For help on inherited properties, please see the parent component (i.e., TRPCBroker).