Sun Java System Mobile Enterprise Platform 1.0 Developer's Guide for Enterprise Connectors

The BusinessObjectProvider Class

Table 3–2 lists the constructor and methods belonging to the BusinessObjectProvider class. This provider class for instances of BusinessObject serves multiple purposes:

An instance of this class is created for each synchronization session. Use the methods initialize() and terminate() to allocate and free session resources.

Table 3–2 Class com.sun.mep.connector.api.BusinessObjectProvider

Method 

Description 

public BusinessObjectProvider()

No-argument constructor. 

public abstract java.util.List<T> getBusinessObjects()

Returns a complete list of the business objects available in the back end associated with this provider. This is in essence a query method for all the instances in the back end. 

public abstract java.lang.String getRepositoryName()

Returns the name of the repository holding these objects. 

public SessionContext getSessionContext()

Returns the session context associated with this provider. 

public <U extends BusinessObjectProvider> TransactionManager<U> getTransactionManager()

Returns the transaction manager associated with this provider, or null if no transaction manager has been set. If null is returned, transactions are not supported by this provider. 

public void initialize()

This method is called right after an instance of this class is created. You can use it to allocate resources for the duration of a synchronization session. Other uses of this method include back-end authentication. Credentials needed for authentication are available from the SessionContext, which you can access by calling getSessionContext().

public abstract T newBusinessObject()

Returns a fresh instance of a business object. 

public void setSessionContext(SessionContext context)

Sets the session context for this provider. 

public void terminate()

This method is called when a synchronization session is about to be terminated. Use this method to free any resources allocated by this object.