Examples of StreamCloser


Examples of org.mule.api.util.StreamCloser

            else
            {
                Iterator closers = muleContext.getRegistry().lookupObjects(StreamCloser.class).iterator();
                while (closers.hasNext())
                {
                    StreamCloser closer = (StreamCloser) closers.next();
                    if (closer.canClose(stream.getClass()))
                    {
                        closer.close(stream);
                    }
                    else
                    {
                        log.debug("Unable to find an StreamCloser for the stream type: " + stream.getClass()
                                  + ", the stream: " + stream + " will not be closed.");
View Full Code Here

Examples of org.mule.api.util.StreamCloser

    @Test
    public void customCloser() throws Exception
    {
        java.io.Closeable closeable = Mockito.mock(java.io.Closeable.class);

        StreamCloser closer = Mockito.mock(StreamCloser.class);
        Mockito.when(closer.canClose(closeable.getClass())).thenReturn(true);
        Mockito.when(this.muleContext.getRegistry().lookupObjects(StreamCloser.class)).thenReturn(
            Arrays.asList(closer));

        this.service.closeStream(closeable);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.