Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.openjpa.kernel;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
import javax.transaction.Synchronization;
import org.apache.openjpa.ee.ManagedRuntime;
import org.apache.openjpa.event.CallbackModes;
import org.apache.openjpa.event.LifecycleEventManager;
import org.apache.openjpa.lib.util.Closeable;
import org.apache.openjpa.meta.ClassMetaData;
import org.apache.openjpa.meta.FieldMetaData;
import org.apache.openjpa.meta.ValueMetaData;
import org.apache.openjpa.util.RuntimeExceptionTranslator;
/**
* The broker is the primary interface into the OpenJPA runtime. Each broker
* maintains an independent object cache and an independent transactional
* context.
*
* @since 0.4.0
* @author Abe White
*/
public interface Broker
extends Synchronization, Closeable, StoreContext,
ConnectionRetainModes, DetachState, LockLevels,
RestoreState, AutoClear, AutoDetach, CallbackModes {
/**
* Set the broker's behavior for implicit actions such as flushing,
* automatic detachment, and exceptions thrown by managed instances outside
* a broker operation. A broker's implicit behavior can only be set once;
* after the first invocation with non-null arguments,
* subsequent invocations of this method are ignored.
*/
void setImplicitBehavior(OpCallbacks call,
RuntimeExceptionTranslator ex);
/**
* Return the factory that produced this broker.
*/
BrokerFactory getBrokerFactory();
/**
* Return the connection retain mode for this broker.
*/
int getConnectionRetainMode();
/**
* Return the managed runtime in use.
*/
ManagedRuntime getManagedRuntime();
/**
* Return the inverse manager in use.
*
* @since 0.3.2
*/
InverseManager getInverseManager();
/**
* Whether the broker or its managed instances are used in a multithreaded
* environment.
*/
boolean getMultithreaded();
/**
* Whether the broker or its managed instances are used in a multithreaded
* environment.
*/
void setMultithreaded(boolean multi);
/**
* Whether to take into account changes in the transaction when executing
* a query or iterating an extent.
*/
boolean getIgnoreChanges();
/**
* Whether to take into account changes in the transaction when executing
* a query or iterating an extent.
*/
void setIgnoreChanges(boolean ignore);
/**
* Whether to allow nontransactional access to persistent state.
*/
boolean getNontransactionalRead();
/**
* Whether to allow nontransactional access to persistent state.
*/
void setNontransactionalRead(boolean read);
/**
* Whether to allow nontransactional changes to persistent state.
*/
boolean getNontransactionalWrite();
/**
* Whether to allow nontransactional changes to persistent state.
*/
void setNontransactionalWrite(boolean write);
/**
* Whether to restore an object's original state on rollback.
*/
int getRestoreState();
/**
* Whether to restore an object's original state on rollback.
*/
void setRestoreState(int restore);
/**
* Whether to use optimistic transactional semantics.
*/
boolean getOptimistic();
/**
* Whether to use optimistic transactional semantics.
*/
void setOptimistic(boolean opt);
/**
* Whether objects retain their persistent state on transaction commit.
*/
boolean getRetainState();
/**
* Whether objects retain their persistent state on transaction commit.
*/
void setRetainState(boolean retain);
/**
* Whether objects clear when entering transactions.
*/
int getAutoClear();
/**
* Whether objects clear when entering transactions.
*/
void setAutoClear(int clear);
/**
* Whether to check for a global transaction upon every managed,
* non-transactional operation. Defaults to false.
*/
boolean getSyncWithManagedTransactions();
/**
* Whether to check for a global transaction upon every managed,
* non-transactional operation. Defaults to false.
*/
void setSyncWithManagedTransactions(boolean resync);
/**
* Bit flags marked in {@link AutoDetach} which indicate when persistent
* managed objects should be automatically detached in-place.
*/
int getAutoDetach();
/**
* Bit flags marked in {@link AutoDetach} which indicate when persistent
* managed objects should be automatically detached in-place.
*/
void setAutoDetach(int flags);
/**
* Bit flags marked in {@link AutoDetach} which indicate when persistent
* managed objects should be automatically detached in-place.
*/
void setAutoDetach(int flag, boolean on);
/**
* Retrieve the current properties for this broker Some of these properties
* may have been changed from the original configuration.
*
* @return the changed properties
*
* @since 2.0.0
*/
Map getProperties();
/**
* Return the supported properties for this broker as property keys. If a
* property has multiple keys, all keys will be returned.
*
* @since 2.0.0
*/
Set getSupportedProperties();
/**
* Whether to treat relations to detached instances during persist
* operations as new or as pseudo-hollow instances.
*/
boolean isDetachedNew();
/**
* Whether to treat relations to detached instances as new.
*/
void setDetachedNew(boolean isNew);
/**
* Whether to also evict an object from the store cache when it is
* evicted through this broker.
*/
boolean getEvictFromDataCache();
/**
* Whether to also evict an object from the store cache when it is
* evicted through this broker.
*/
void setEvictFromDataCache(boolean evict);
/**
* Put the specified key-value pair into the map of user objects. Use
* a value of null to remove the key.
*
* @since 0.3.2
*/
Object putUserObject(Object key, Object val);
/**
* Get the value for the specified key from the map of user objects.
*
* @since 0.3.2
*/
Object getUserObject(Object key);
/**
* Register a listener for transaction-related events.
*
* @since 0.2.5
*/
void addTransactionListener(Object listener);
/**
* Remove a listener for transaction-related events.
*
* @since 0.2.5
*/
void removeTransactionListener(Object listener);
/**
* Gets an umodifiable collection of currently registered lsteners.
*
* @since 2.0.0
*/
Collection