Project Wonder 2.0

er.corebusinesslogic
Class ERCoreBusinessLogic

java.lang.Object
  extended byer.extensions.ERXFrameworkPrincipal
      extended byer.corebusinesslogic.ERCoreBusinessLogic

public class ERCoreBusinessLogic
extends ERXFrameworkPrincipal


Field Summary
protected  NSArray _emailsForProblemRecipients
          caches the email addresses to send to in the case of problems
protected  String _problemEmailDomain
          caches the problem email address domain
static ERXLogger log
          logging support
static String ProblemEmailDomainPropertyKey
          property key that holds the email domain of the generated from email
static String ProblemEmailRecipientsPropertyKey
          property key that holds the emails of those who recieve problem emails
protected static ERCoreBusinessLogic sharedInstance
          holds the shared instance reference
 
Constructor Summary
ERCoreBusinessLogic()
           
 
Method Summary
static EOEnterpriseObject actor()
          Gets the actor.
static EOEnterpriseObject actor(EOEditingContext ec)
          Gets the actor as a local instance in the given context.
 void addPreferenceRelationshipToActorEntity(String entityName, String attributeNameToJoin)
          Registers a run-time relationship called "preferences" on the actor entity of your business logic.
 NSArray emailsForProblemRecipients()
          Gets the array of email addresses to send emails about problems to.
 void finishInitialization()
          Called when it is time to finish the initialization of the framework.
 void initializeSharedData()
          Initializes the shared eof data.
static void invalidateStaticValueForKeyCache()
           
 String problemEmailDomain()
          Gets the problem email domain.
 void reportException(Throwable exception, NSDictionary extraInfo)
          Reports an exception.
static void setActor(EOEnterpriseObject actor)
          Sets the actor in the current thread storage.
 void setEmailsForProblemRecipients(NSArray a)
          Sets the emails for problem recipients.
 void setProblemEmailDomain(String value)
          Sets the problem email domain.
static ERCoreBusinessLogic sharedInstance()
          Gets the shared instance of the ERCoreBusinessLogic.
 boolean shouldMailReportedExceptions()
           
static int staticStoredIntValueForKey(String key)
           
static int staticStoredIntValueForKey(String key, boolean noCache)
           
static int staticStoredIntValueForKey(String key, EOEditingContext ec)
           
static String staticStoredValueForKey(String key)
           
static String staticStoredValueForKey(String key, boolean noCache)
           
static String staticStoredValueForKey(String key, EOEditingContext ec)
           
static void takeStaticStoredValueForKey(String value, String key)
           
static void takeStaticStoredValueForKey(String value, String key, EOEditingContext editingContext)
           
 
Methods inherited from class er.extensions.ERXFrameworkPrincipal
finishInitialization, log, setUpFrameworkPrincipalClass, sharedInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final ERXLogger log
logging support


ProblemEmailDomainPropertyKey

public static final String ProblemEmailDomainPropertyKey
property key that holds the email domain of the generated from email

See Also:
Constant Field Values

ProblemEmailRecipientsPropertyKey

public static final String ProblemEmailRecipientsPropertyKey
property key that holds the emails of those who recieve problem emails

See Also:
Constant Field Values

sharedInstance

protected static ERCoreBusinessLogic sharedInstance
holds the shared instance reference


_emailsForProblemRecipients

protected NSArray _emailsForProblemRecipients
caches the email addresses to send to in the case of problems


_problemEmailDomain

protected String _problemEmailDomain
caches the problem email address domain

Constructor Detail

ERCoreBusinessLogic

public ERCoreBusinessLogic()
Method Detail

sharedInstance

public static ERCoreBusinessLogic sharedInstance()
Gets the shared instance of the ERCoreBusinessLogic.

Returns:
shared instance.

setActor

public static void setActor(EOEnterpriseObject actor)
Sets the actor in the current thread storage.

Parameters:
actor - current user for this thread

actor

public static EOEnterpriseObject actor(EOEditingContext ec)
Gets the actor as a local instance in the given context.

Parameters:
ec - editing context to pull a local copy of the actor into
Returns:
actor instance in the given editing context

actor

public static EOEnterpriseObject actor()
Gets the actor.

Returns:
current actor for the thread

staticStoredValueForKey

public static String staticStoredValueForKey(String key)

staticStoredIntValueForKey

public static int staticStoredIntValueForKey(String key)

staticStoredValueForKey

public static String staticStoredValueForKey(String key,
                                             boolean noCache)

staticStoredIntValueForKey

public static int staticStoredIntValueForKey(String key,
                                             boolean noCache)

staticStoredValueForKey

public static String staticStoredValueForKey(String key,
                                             EOEditingContext ec)

staticStoredIntValueForKey

public static int staticStoredIntValueForKey(String key,
                                             EOEditingContext ec)

takeStaticStoredValueForKey

public static void takeStaticStoredValueForKey(String value,
                                               String key,
                                               EOEditingContext editingContext)

takeStaticStoredValueForKey

public static void takeStaticStoredValueForKey(String value,
                                               String key)

invalidateStaticValueForKeyCache

public static void invalidateStaticValueForKeyCache()

finishInitialization

public void finishInitialization()
Called when it is time to finish the initialization of the framework.

Specified by:
finishInitialization in class ERXFrameworkPrincipal

initializeSharedData

public void initializeSharedData()
Initializes the shared eof data.


shouldMailReportedExceptions

public boolean shouldMailReportedExceptions()

addPreferenceRelationshipToActorEntity

public void addPreferenceRelationshipToActorEntity(String entityName,
                                                   String attributeNameToJoin)
Registers a run-time relationship called "preferences" on the actor entity of your business logic. The framework needs preferences relationship to access user preferences for a specific actor. Call this method when you initialize your business logic layer. (Check BTBusinessLogic class as an example.)

Parameters:
entityName - String name for your actor entity
attributeNameToJoin - String attribute name on the actor entity; used by the relationship and typically it's the primary key.

emailsForProblemRecipients

public NSArray emailsForProblemRecipients()
Gets the array of email addresses to send emails about problems to.

Returns:
array of email addresses

setEmailsForProblemRecipients

public void setEmailsForProblemRecipients(NSArray a)
Sets the emails for problem recipients. Should be an array of email addresses to report exceptions to in production applications.

Parameters:
a - array of email addresses

problemEmailDomain

public String problemEmailDomain()
Gets the problem email domain. This is used for constructing the from address when reporting an exception. Should be of the form: foo.com.

Returns:
problem email address domain

setProblemEmailDomain

public void setProblemEmailDomain(String value)
Sets the problem email domain.

Parameters:
value - to set problem domain to

reportException

public void reportException(Throwable exception,
                            NSDictionary extraInfo)
Reports an exception. If caching is enabled then the exception will also be emailed to the problem mail recipients.

Parameters:
exception - to be reported
extraInfo - dictionary of extra information about what was happening when the exception was thrown.

Last updated: Do, Dez 9, 2004 • 12:46 PM CET

Copyright © 2002 – 2004 Project Wonder.