resource

package resource

Package related methods for maanged resources.

Visibility
  1. Public
  2. All

Type Members

  1. trait AbstractManagedResource [R] extends ManagedResource[R] with ManagedResourceOperations[R]

    Abstract class implementing most of the managed resource features in terms of an open and close method.

  2. trait CanSafelyFlatMap [-MappedElem, +To] extends AnyRef

    This trait's existence signifies that a ManagedResource can be "flatMap"ed into a another type safely or needs to remain inside the monad.

  3. trait CanSafelyMap [-MappedElem, +To] extends AnyRef

    This trait's existence signifies that a ManagedResource can be converted to some type safely, or needs to remain inside the monad.

  4. class DefaultManagedResource [R] extends AbstractManagedResource[R]

    This is the default implementation of a ManagedResource that makes use of the Resource type trait.

  5. type ErrorHolder [A] = Either[List[Throwable], A]

    The type used to hold errors and results in the same return value.

    The type used to hold errors and results in the same return value.

    Definition Classes
    package
  6. trait ExtractableManagedResource [+A] extends ManagedResource[A]

    This trait represents a resource that has been modified (or will be modified) inside an ARM block in such a way that the resulting value can be extracted outside of the "ManagedResource" monad.

  7. trait HighPrioritCanSafelyMapImplicits extends LowPriorityCanSafelyMapImplicits

    Contains medium priority implicits for CanSafelyTranslate.

  8. trait LowPrioritCanSafelyFlatMapImplicits extends AnyRef

    Contains higher priority translations for ManagedResource map and flatMap calls.

  9. trait LowPriorityCanSafelyMapImplicits extends AnyRef

    Contains the low priority implicits for CanSafelyTranslate.

  10. trait LowPriorityResourceImplicits extends AnyRef

    Trait holding type class implementations for Resource.

  11. trait ManagedResource [+R] extends AnyRef

    This class encapsulates a method of ensuring a resource is opened/closed during critical stages of its lifecycle.

  12. trait ManagedResourceOperations [+R] extends ManagedResource[R]

    This class implements all ManagedResource methods except acquireFor.

  13. trait ManagedTraversable [+B, A] extends Traversable[B]

    This trait provides a means to ensure traversable access to items inside a resource, while ensuring that the resource is opened/closed appropriately before/after the traversal.

  14. trait MediumPriorityResourceImplicits extends LowPriorityResourceImplicits

    Attributes
    sealed
  15. trait Resource [R] extends AnyRef

    This is a type trait for types that are considered 'resources'.

Value Members

  1. object CanSafelyFlatMap extends LowPrioritCanSafelyFlatMapImplicits

    This companion object contains implicits used on ManagedResource.

  2. object CanSafelyMap extends HighPrioritCanSafelyMapImplicits

    This companion object contains implicits used on ManagedResource map calls.

  3. object Resource extends MediumPriorityResourceImplicits

    Companion object to the Resource type trait.

  4. def and [A, B] (r1: ManagedResource[A], r2: ManagedResource[B]): ManagedResource[(A, B)] with ManagedResourceOperations[(A, B)] { def acquireFor[C](f: ((A, B)) => C): Nothing }

    Combined two resources such that they are both opened/closed together.

    Combined two resources such that they are both opened/closed together. The first resource is opened before the second resource and closed after the second resource, however the resulting ManagedResource acts like both are opened/closed together.

    returns

    A ManagedResource of a tuple containing the initial two resources.

    Definition Classes
    package
  5. def extractOption [T] : CanSafelyMap[T, Option[T]]

    Definition Classes
    package
    See also

    CanSafelyTranslate.extractOption

  6. def extractUnManaged [T] : CanSafelyMap[T, T]

    Definition Classes
    package
    See also

    CanSafelyTranslate.extractUnManaged

  7. def join [A, MR, CC] (resources: CC)(implicit ev0: <:<[CC, Seq[MR]], ev1: <:<[MR, ManagedResource[A]]): ManagedResource[Seq[A]]

    Takes a sequence of ManagedResource objects and traits them as a ManagedResource of a Sequence of Objects.

    Takes a sequence of ManagedResource objects and traits them as a ManagedResource of a Sequence of Objects.

    This is useful for dealing with many resources within the same scope.

    returns

    A ManagedResoruce of a collection of types

    Definition Classes
    package
  8. def makeManagedResource [R] (opener: ⇒ R)(closer: (R) ⇒ Unit)(nonFatalExceptions: List[Class[_ <: Throwable]])(implicit arg0: Manifest[R]): DefaultManagedResource[R]

    Constructs a managed resource using function objects for each abstract method.

    Constructs a managed resource using function objects for each abstract method.

    opener

    The by-name parameter that will open the resource.

    closer

    A closure that will close the resource.

    nonFatalExceptions

    A list of exception classes we can temporarily ignore when operating on a resource.

    Definition Classes
    package
  9. def managed [A] (opener: ⇒ A)(implicit arg0: Resource[A], arg1: Manifest[A]): ManagedResource[A]

    Creates a ManagedResource for any type with a Resource type class implementation.

    Creates a ManagedResource for any type with a Resource type class implementation. This includes all java.io.Closeable subclasses, and any types that have a close or dispose method. You can also provide your own resource type class implementations in your own scope.

    Definition Classes
    package
  10. def withResources [C] (f: ⇒ C @util.continuations.package.cps[Either[List[Throwable],C]]): Nothing

    Starts block that will use continuation-based resource handling.

    Starts block that will use continuation-based resource handling. This is where you can nest resources directly without having to worry about closing the block. Example:

    Definition Classes
    package