Difference between revisions of "Documentation/DevGuide/UCB/Content Provider Proxies"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (FINAL VERSION FOR L10N)
 
Line 14: Line 14:
 
Instead of registering the real instantiated UCP at the UCB, a proxy is created for the UCP. The UCP registration information is passed to the proxy. The proxy only uses this information to instantiate the real UCP on demand. There is almost no performance overhead with this mechanism.
 
Instead of registering the real instantiated UCP at the UCB, a proxy is created for the UCP. The UCP registration information is passed to the proxy. The proxy only uses this information to instantiate the real UCP on demand. There is almost no performance overhead with this mechanism.
  
{{Documentation/Note|When using preconfigured UCBs, the UCB implementation uses proxies instead of the real UCPs to avoid wasting resources.}}
+
{{Note|When using preconfigured UCBs, the UCB implementation uses proxies instead of the real UCPs to avoid wasting resources.}}
  
 
{{PDL1}}
 
{{PDL1}}
  
 
[[Category:Documentation/Developer's Guide/Universal Content Broker]]
 
[[Category:Documentation/Developer's Guide/Universal Content Broker]]

Latest revision as of 14:59, 4 July 2018



The UNO service implementing a UCP must be instantiated at the time the content provider is registered at the UCB. This is done using com.sun.star.ucb.XContentProviderManager's registerContentProvider() method. In some cases, this can consume resources, because instantiating a UNO service means loading the libraries containing its code. As a convention, each UNO component should reside in its own library.

Therefore, a special UNO service is offered that provides a generic proxy for a UCP. Its purpose is to delay the loading of the real UCP code until it is needed. Generally, this does not happen before the first createContentIdentifier()/queryContent() calls are done at the proxy.

Instead of registering the real instantiated UCP at the UCB, a proxy is created for the UCP. The UCP registration information is passed to the proxy. The proxy only uses this information to instantiate the real UCP on demand. There is almost no performance overhead with this mechanism.

Documentation note.png When using preconfigured UCBs, the UCB implementation uses proxies instead of the real UCPs to avoid wasting resources.
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages