org.chorem.pollen.services
Class DefaultPollenServiceContext

java.lang.Object
  extended by org.chorem.pollen.services.DefaultPollenServiceContext
All Implemented Interfaces:
PollenServiceContext

public class DefaultPollenServiceContext
extends Object
implements PollenServiceContext

Instances of this class will be given to service factory.

Since:
1.3
Author:
tchemit

Field Summary
protected  PollenConfiguration configuration
           
protected  Locale locale
           
protected  PollenServiceFactory serviceFactory
           
protected  org.nuiton.topia.TopiaContext transaction
           
 
Constructor Summary
protected DefaultPollenServiceContext(Locale locale, org.nuiton.topia.TopiaContext transaction, PollenConfiguration configuration, PollenServiceFactory serviceFactory)
           
 
Method Summary
 String createPollenUrlId()
          Create an id to easily managed polls using urls.
 URL getApplicationURL()
           
 PollenConfiguration getConfiguration()
           
 Date getCurrentTime()
           
 Locale getLocale()
           
 PollenServiceFactory getServiceFactory()
           
 org.nuiton.topia.TopiaContext getTransaction()
           
static PollenServiceContext newContext(Locale locale, org.nuiton.topia.TopiaContext transaction, PollenConfiguration configuration, PollenServiceFactory serviceFactory)
           
static PollenServiceContext newContext(PollenServiceContext serviceContext, org.nuiton.topia.TopiaContext transaction)
           
<E extends PollenService>
E
newService(Class<E> clazz)
           
 void setTransaction(org.nuiton.topia.TopiaContext transaction)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transaction

protected org.nuiton.topia.TopiaContext transaction

serviceFactory

protected PollenServiceFactory serviceFactory

configuration

protected PollenConfiguration configuration

locale

protected Locale locale
Constructor Detail

DefaultPollenServiceContext

protected DefaultPollenServiceContext(Locale locale,
                                      org.nuiton.topia.TopiaContext transaction,
                                      PollenConfiguration configuration,
                                      PollenServiceFactory serviceFactory)
Method Detail

newContext

public static PollenServiceContext newContext(PollenServiceContext serviceContext,
                                              org.nuiton.topia.TopiaContext transaction)

newContext

public static PollenServiceContext newContext(Locale locale,
                                              org.nuiton.topia.TopiaContext transaction,
                                              PollenConfiguration configuration,
                                              PollenServiceFactory serviceFactory)

getTransaction

public org.nuiton.topia.TopiaContext getTransaction()
Specified by:
getTransaction in interface PollenServiceContext

setTransaction

public void setTransaction(org.nuiton.topia.TopiaContext transaction)
Specified by:
setTransaction in interface PollenServiceContext

getLocale

public Locale getLocale()
Specified by:
getLocale in interface PollenServiceContext

getApplicationURL

public URL getApplicationURL()
Specified by:
getApplicationURL in interface PollenServiceContext

newService

public <E extends PollenService> E newService(Class<E> clazz)
Specified by:
newService in interface PollenServiceContext

getConfiguration

public PollenConfiguration getConfiguration()
Specified by:
getConfiguration in interface PollenServiceContext

getServiceFactory

public PollenServiceFactory getServiceFactory()
Specified by:
getServiceFactory in interface PollenServiceContext

createPollenUrlId

public String createPollenUrlId()
Create an id to easily managed polls using urls.

Specified by:
createPollenUrlId in interface PollenServiceContext
Returns:
a fresh generated String

getCurrentTime

public Date getCurrentTime()
Specified by:
getCurrentTime in interface PollenServiceContext
Returns:
the current date


Copyright © 2009-2012 CodeLutin. All Rights Reserved.