EMMA??Coverage??Report??(generated??Fri??May??15??16:21:14??BST??2009)
[all??classes][org.apache.james.mpt]

COVERAGE??SUMMARY??FOR??SOURCE??FILE??[ExternalSessionFactory.java]

nameclass,??%method,??%block,??%line,??%
ExternalSessionFactory.java100%??(1/1)50%????(2/4)59%????(54/91)67%????(10/15)

COVERAGE??BREAKDOWN??BY??CLASS??AND??METHOD

nameclass,??%method,??%block,??%line,??%
??????????
class??ExternalSessionFactory100%??(1/1)50%????(2/4)59%????(54/91)67%????(10/15)
reset??():??void??0%??????(0/1)0%??????(0/5)0%??????(0/2)
toString??():??String??0%??????(0/1)0%??????(0/32)0%??????(0/3)
ExternalSessionFactory??(String,??int,??Monitor,??String):??void??100%??(1/1)100%??(16/16)100%??(5/5)
newSession??(HostSystem$Continuation):??Session??100%??(1/1)100%??(38/38)100%??(5/5)

1/****************************************************************
2??*??Licensed??to??the??Apache??Software??Foundation??(ASF)??under??one??????*
3??*??or??more??contributor??license??agreements.????See??the??NOTICE??file??*
4??*??distributed??with??this??work??for??additional??information????????????????*
5??*??regarding??copyright??ownership.????The??ASF??licenses??this??file??????*
6??*??to??you??under??the??Apache??License,??Version??2.0??(the????????????????????????*
7??*??"License");??you??may??not??use??this??file??except??in??compliance??????*
8??*??with??the??License.????You??may??obtain??a??copy??of??the??License??at??????*
9??*????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????*
10??*??????http://www.apache.org/licenses/LICENSE-2.0??????????????????????????????????*
11??*????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????*
12??*??Unless??required??by??applicable??law??or??agreed??to??in??writing,??????*
13??*??software??distributed??under??the??License??is??distributed??on??an????*
14??*??"AS??IS"??BASIS,??WITHOUT??WARRANTIES??OR??CONDITIONS??OF??ANY??????????????*
15??*??KIND,??either??express??or??implied.????See??the??License??for??the????????*
16??*??specific??language??governing??permissions??and??limitations????????????*
17??*??under??the??License.??????????????????????????????????????????????????????????????????????????????????????*
18??****************************************************************/
19??
20package??org.apache.james.mpt;
21??
22import??java.net.InetSocketAddress;
23import??java.nio.channels.SocketChannel;
24??
25import??org.apache.james.mpt.HostSystem.Continuation;
26??
27/**
28??*??Session??factory??creates??session??which??connection??to??a??server??port.
29??*/
30public??class??ExternalSessionFactory??implements??SessionFactory??{
31??
32????????public??static??final??String??IMAP_SHABANG??=??"*??OK??IMAP4rev1??Server??ready";
33????????protected??final??InetSocketAddress??address;
34????????protected??final??Monitor??monitor;
35????????protected??final??String??shabang;
36??
37????????public??ExternalSessionFactory(final??String??host,??final??int??port,??final??Monitor??monitor,??final??String??shabang)??{
38????????????????super();
39????????????????this.address??=??new??InetSocketAddress(host,??port);
40????????????????this.monitor??=??monitor;
41????????????????this.shabang??=??shabang;
42????????}
43??
44????????public??Session??newSession(Continuation??continuation)??throws??Exception??{
45????????????????monitor.note("Connecting??to??"??+??address.getHostName()??+??":"??+??address.getPort());
46????????????????final??SocketChannel??channel??=??SocketChannel.open(address);
47????????????????channel.configureBlocking(false);
48????????????????final??ExternalSession??result??=??new??ExternalSession(channel,??monitor,??shabang);
49????????????????return??result;
50????????}
51??
52????????public??void??reset()??throws??Exception??{
53????????????????monitor.note("Please??reset??system.");
54????????}
55??
56????????/**
57??????????*??Constructs??a??<code>String</code>??with??all??attributes
58??????????*??in??name??=??value??format.
59??????????*
60??????????*??@return??a??<code>String</code>??representation??
61??????????*??of??this??object.
62??????????*/
63????????public??String??toString()
64????????{
65????????????????final??String??TAB??=??"??";
66??
67????????????????String??retValue??=??"ExternalSessionFactory??(??"
68????????????????????????+??"address??=??"??+??this.address??+??TAB
69????????????????????????+??"monitor??=??"??+??this.monitor??+??TAB
70????????????????????????+??"shabang??=??"??+??this.shabang??+??TAB
71????????????????????????+??"??)";
72??
73????????????????return??retValue;
74????????}
75}

[all??classes][org.apache.james.mpt]
EMMA??2.0.5312??(C)??Vladimir??Roubtsov