001: package org.apache.ojb.broker;
002:
003: /* Copyright 2002-2005 The Apache Software Foundation
004: *
005: * Licensed under the Apache License, Version 2.0 (the "License");
006: * you may not use this file except in compliance with the License.
007: * You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: import org.apache.ojb.broker.accesslayer.RelationshipPrefetcherFactory;
019: import org.apache.ojb.broker.core.QueryReferenceBroker;
020: import org.apache.ojb.broker.core.proxy.ProxyFactory;
021: import org.apache.ojb.broker.metadata.ClassDescriptor;
022:
023: /**
024: * Extended version of the {@link PersistenceBroker} specifying additional functionality
025: * that is only relevant internally.
026: *
027: * @author Armin Waibel
028: * @version $Id: PersistenceBrokerInternal.java,v 1.1.2.6 2005/12/29 22:47:48 tomdz Exp $
029: */
030: public interface PersistenceBrokerInternal extends PersistenceBroker {
031: /**
032: * Determines whether this instance is handled by a managed
033: * environment, i.e. whether it is registered within a JTA transaction.
034: *
035: * @return <code>true</code> if this broker is managed
036: */
037: public boolean isManaged();
038:
039: /**
040: * Specifies whether this instance is handled by a managed
041: * environment, i.e. whether it is registered within a JTA transaction.
042: * Note that on {@link #close()} this will automatically be reset
043: * to <em>false</em>.
044: *
045: * @param managed <code>true</code> if this broker is managed
046: */
047: public void setManaged(boolean managed);
048:
049: /**
050: * Performs the real store work (insert or update) and is intended for use by
051: * top-level apis internally.
052: *
053: * @param obj The object to store
054: * @param oid The identity of the object to store
055: * @param cld The class descriptor of the object
056: * @param insert If <em>true</em> an insert operation will be performed, else update
057: * operation
058: * @param ignoreReferences Whether automatic storing of contained references/collections (except
059: * super-references) shall be suppressed (independent of the auto-update
060: * setting in the metadata)
061: */
062: public void store(Object obj, Identity oid, ClassDescriptor cld,
063: boolean insert, boolean ignoreReferences);
064:
065: /**
066: * Deletes the persistence representation of the given object in the underlying
067: * persistence system. This method is intended for use in top-level apis internally.
068: *
069: * @param obj The object to delete
070: * @param ignoreReferences Whether automatic deletion of contained references/collections (except
071: * super-references) shall be suppressed (independent of the auto-delete
072: * setting in the metadata)
073: */
074: public void delete(Object obj, boolean ignoreReferences)
075: throws PersistenceBrokerException;
076:
077: /**
078: * Returns the broker specifically for retrieving references via query.
079: *
080: * @return The query reference broker
081: */
082: public QueryReferenceBroker getReferenceBroker();
083:
084: /**
085: * Refreshes the references of the given object whose <code>refresh</code>
086: * is set to <code>true</code>.
087: *
088: * @param obj The object to check
089: * @param oid The identity of the object
090: * @param cld The class descriptor for the object
091: */
092: public void checkRefreshRelationships(Object obj, Identity oid,
093: ClassDescriptor cld);
094:
095: /**
096: * Return the factory for creating relationship prefetcher objects.
097: *
098: * @return The factory
099: */
100: public RelationshipPrefetcherFactory getRelationshipPrefetcherFactory();
101:
102: /**
103: * Return the factory for creating proxies.
104: *
105: * @return The factory
106: */
107: public ProxyFactory getProxyFactory();
108:
109: /**
110: * Shortcut method for creating a proxy of the given type.
111: *
112: * @param proxyClass The proxy type
113: * @param realSubjectsIdentity The identity of the real subject
114: * @return The proxy
115: */
116: public Object createProxy(Class proxyClass,
117: Identity realSubjectsIdentity);
118: }
|