resource

package resource

Package related methods for managed resources.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. resource
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. abstract class 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. final class ConstantManagedResource[V] extends AbstractManagedResource[V]

    ConstantManagedResource encapsulates a constant value with no associated resource management.

  3. final class DefaultManagedResource[R] extends AbstractManagedResource[R]

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

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

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

  5. 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.

  6. case class ExtractedEither[+A, +B](either: Either[A, B]) extends Product with Serializable

    This is a helper class to work around Either pattern matching issues.

  7. sealed trait LowPriorityResourceImplicits extends AnyRef

    Trait holding type class implementations for Resource.

  8. trait ManagedResource[+R] extends AnyRef

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

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

    This class implements all ManagedResource methods except acquireFor.

  10. 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.

  11. sealed trait MediumPriorityResourceImplicits extends LowPriorityResourceImplicits

  12. trait Resource[R] extends AnyRef

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

Value Members

  1. object Resource extends MediumPriorityResourceImplicits

    Companion object to the Resource type trait.

  2. object Using

    Convenience methods for common java IO operations.

  3. def and[A, B](r1: ManagedResource[A], r2: ManagedResource[B]): ManagedResource[(A, B)]

    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.

  4. def constant[V](value: V): ManagedResource[V]

    Use this to encapsulate a constant value inside a ManagedResource with no resource management.

  5. implicit def extractedEitherToEither[A, B](extracted: ExtractedEither[A, B]): Either[A, B]

  6. 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.

    resources

    A collection of ManageResources of the same type

    returns

    A ManagedResoruce of a collection of types

  7. def makeManagedResource[R](opener: ⇒ R)(closer: (R) ⇒ Unit)(exceptions: List[Class[_ <: Throwable]])(implicit arg0: OptManifest[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.

    exceptions

    A list of exception classes that cannot be ignored to close a resource.

  8. def managed[A](opener: ⇒ A)(implicit arg0: Resource[A], arg1: OptManifest[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.

  9. def shared[A](opener: ⇒ A)(implicit arg0: Resource[A], arg1: OptManifest[A]): ManagedResource[A]

    Creates a ManagedResource shared by all users for any type with a Resource type class implementation.

    Creates a ManagedResource shared by all users for any type with a Resource type class implementation.

    There is only one instance of the resource at the same time for all the users. The instance will be closed once no user is still using it.

Inherited from AnyRef

Inherited from Any

Ungrouped