resource

ExtractableManagedResource

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. There are two mechanisms for extracting resources. One which returns an optional value, where None is returned if any error occurs during extraction. The other returns an Either where the left side contains any error that occured during extraction and the right side contains the extracted value.

Linear Supertypes
ManagedResource[A], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. ExtractableManagedResource
  2. ManagedResource
  3. AnyRef
  4. Any
Visibility
  1. Public
  2. All

Abstract Value Members

  1. def ! : A @scala.util.continuations.cpsParam[Unit,Unit]

    Accesses this resource inside a suspendable CPS block

    Accesses this resource inside a suspendable CPS block

    Attributes
    abstract
    Definition Classes
    ManagedResource
  2. def acquireAndGet [B] (f: (A) ⇒ B): B

    Acquires the resource for the Duration of a given function, The resource will automatically be opened and closed.

    Acquires the resource for the Duration of a given function, The resource will automatically be opened and closed. The result will be returned immediately, except in the case of an error. Upon error, the resource will be closed, and then the originating exception will be thrown.

    Note: This method will throw the last exception encountered by the managed resource, whatever this happens to be.

    f

    A function to execute against the handle returned by the resource

    returns

    The result of the passed in function

    Attributes
    abstract
    Definition Classes
    ManagedResource
  3. def acquireFor [B] (f: (A) ⇒ B): Either[List[Throwable], B]

    Aquires the resource for the Duration of a given function, The resource will automatically be opened and closed.

    Aquires the resource for the Duration of a given function, The resource will automatically be opened and closed. The result will be returned immediately in an Either container. This container will hold all errors, if any occurred during execution, or the resulting value.

    f

    A function to execute against the raw resource.

    returns

    The result of the function (right) or the list of exceptions seen during the processing of the resource (left).

    Attributes
    abstract
    Definition Classes
    ManagedResource
  4. def and [B] (that: ManagedResource[B]): ManagedResource[(A, B)]

    Creates a new resource that is the aggregation of this resource and another.

    Creates a new resource that is the aggregation of this resource and another.

    that

    The other resource

    @return A resource that is a tupled combination of this and that.

    Attributes
    abstract
    Definition Classes
    ManagedResource
  5. def either : Either[Seq[Throwable], A]

    This method is used to extract the resource being managed.

    This method is used to extract the resource being managed.

    This allows you to pull information out of the Managed resource, as such, the Resource will not be "available" after this method call.

    @returns An either where the left hand side is the currently contained resource unless exceptions, in which case the right hand side will contain the sequence of throwable encountered.

    Attributes
    abstract
  6. def flatMap [B, To] (f: (A) ⇒ B)(implicit translator: CanSafelyFlatMap[B, To]): To

    This method is used to immediately perform operations on a resource while it is open, ensuring the resource is closed before returning.

    This method is used to immediately perform operations on a resource while it is open, ensuring the resource is closed before returning.

    f

    The transformation function to apply against the raw resource.

    translator

    The translation implementation used to determine if we can extract from the ManagedResource.

    returns

    A new ManagedResource with the translated type or some other type if an appropriate translator was found.

    Attributes
    abstract
    Definition Classes
    ManagedResource
  7. def foreach (f: (A) ⇒ Unit): Unit

    This method is used to immediately perform operations on a resource while it is open, ensuring the resource is closed before returning.

    This method is used to immediately perform operations on a resource while it is open, ensuring the resource is closed before returning. Note: This method *will* open and close the resource, performing the body of the method immediately.

    f

    The function to apply against the raw resource.

    Attributes
    abstract
    Definition Classes
    ManagedResource
  8. def map [B, To] (f: (A) ⇒ B)(implicit translator: CanSafelyMap[B, To]): To

    This method is used to perform operations on a resource while the resource is open.

    This method is used to perform operations on a resource while the resource is open.

    f

    The transformation function to apply against the raw resource.

    translator

    The translation implementation used to determine if we can extract from the ManagedResource.

    returns

    A new ManagedResource with the translated type or some other type if an appropriate translator was found.

    Attributes
    abstract
    Definition Classes
    ManagedResource
  9. def opt : Option[A]

    This method is used to extract the resource being managed.

    This method is used to extract the resource being managed.

    This allows you to pull information out of the Managed resource, as such, the Resource will not be "available" after this method call.

    @returns Some(containedValue) if there have been no processing errors, None otherwise

    Attributes
    abstract
  10. def reflect [B] : A @util.continuations.package.cps[Either[List[Throwable],B]]

    Reflects the resource for use in a continuation.

    Reflects the resource for use in a continuation. This method is designed to be used inside a scala.resource.withResources call.

    For example:

    import scala.resource._
    withResources {
      val output = managed(new FileInputStream("output.txt")).reflect[Unit]
      for(i <- 1 to 10) {
        val input = managed(new FileInputStream("sample"+i+".txt")).reflect[Unit]
        input lines foreach (output writeLine _)
      }
    }
    

    returns

    The raw resource, with appropriate continuation-context annotations.

    Attributes
    abstract
    Definition Classes
    ManagedResource
  11. def toTraversable [B] (f: (A) ⇒ TraversableOnce[B]): Traversable[B]

    This method creates a Traversable in which all performed methods are done within the context of an "open" resource.

    This method creates a Traversable in which all performed methods are done within the context of an "open" resource. Note: Every iteration will attempt to open and close the resource!

    f

    A function that transforms the raw resource into an Iterator of elements of type B.

    returns

    A Traversable of elements of type B.

    Attributes
    abstract
    Definition Classes
    ManagedResource

Concrete Value Members

  1. def != (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  2. def != (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  3. def ## (): Int

    Attributes
    final
    Definition Classes
    AnyRef → Any
  4. def == (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  5. def == (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  6. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  7. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  8. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  9. def equals (arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  10. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  11. def flatMap [B] (f: (A) ⇒ B): ManagedResource[B]

    [use case] This method is used to immediately perform operations on a resource while it is open, ensuring the resource is closed before returning.

    [use case]

    This method is used to immediately perform operations on a resource while it is open, ensuring the resource is closed before returning.

    f

    The transformation function to apply against the raw resource.

    returns

    A new ManagedResource with the translated type or some other type if an appropriate translator was found.

    Attributes
    abstract
    Definition Classes
    ManagedResource
  12. def flatMap [B] (f: (A) ⇒ Traversable[B]): Traversable[B]

    [use case] This method is used to immediately perform operations on a resource while it is open, ensuring the resource is closed before returning.

    [use case]

    This method is used to immediately perform operations on a resource while it is open, ensuring the resource is closed before returning.

    f

    The transformation function to apply against the raw resource.

    returns

    A new ManagedResource with the translated type or some other type if an appropriate translator was found.

    Attributes
    abstract
    Definition Classes
    ManagedResource
  13. def flatMap [B] (f: (A) ⇒ ManagedResource[B]): ManagedResource[B]

    [use case] This method is used to immediately perform operations on a resource while it is open, ensuring the resource is closed before returning.

    [use case]

    This method is used to immediately perform operations on a resource while it is open, ensuring the resource is closed before returning.

    f

    The transformation function to apply against the raw resource.

    returns

    A new ManagedResource with the translated type or some other type if an appropriate translator was found.

    Attributes
    abstract
    Definition Classes
    ManagedResource
  14. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef
  15. def hashCode (): Int

    Definition Classes
    AnyRef → Any
  16. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  17. def map [B] (f: (A) ⇒ B): ManagedResource[B]

    [use case] This method is used to perform operations on a resource while the resource is open.

    [use case]

    This method is used to perform operations on a resource while the resource is open.

    f

    The transformation function to apply against the raw resource.

    returns

    A new ManagedResource with the translated type or some other type if an appropriate translator was found.

    Attributes
    abstract
    Definition Classes
    ManagedResource
  18. def map [B] (f: (A) ⇒ Traversable[B]): Traversable[B]

    [use case] This method is used to perform operations on a resource while the resource is open.

    [use case]

    This method is used to perform operations on a resource while the resource is open.

    f

    The transformation function to apply against the raw resource.

    returns

    A new ManagedResource with the translated type or some other type if an appropriate translator was found.

    Attributes
    abstract
    Definition Classes
    ManagedResource
  19. def map [B] (f: (A) ⇒ ManagedResource[B]): ManagedResource[B]

    [use case] This method is used to perform operations on a resource while the resource is open.

    [use case]

    This method is used to perform operations on a resource while the resource is open.

    f

    The transformation function to apply against the raw resource.

    returns

    A new ManagedResource with the translated type or some other type if an appropriate translator was found.

    Attributes
    abstract
    Definition Classes
    ManagedResource
  20. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  21. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  22. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  23. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  24. def toString (): String

    Definition Classes
    AnyRef → Any
  25. def wait (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  26. def wait (arg0: Long, arg1: Int): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  27. def wait (arg0: Long): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from ManagedResource[A]

Inherited from AnyRef

Inherited from Any