newbie question

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

newbie question

Greg Tam
I want to create a file server is Grizzly the correct framework to use?

The file server will allow connections from clients that will upload and download files that could be x MB in size.
Reply | Threaded
Open this post in threaded view
|

Re: newbie question

Erik Svensson-3
> I want to create a file server is Grizzly the correct framework to  
> use?
>
> The file server will allow connections from clients that will upload  
> and download files that could be x MB in size.

Have you decided on a protocol?
A web-server will allow you to this out-of-the-box. You just have to  
set it up right.
Or a ftp/sftp-server?

What I'm aiming for is, you don't have to write a server for this.

cheers
/Erik

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: newbie question

Greg Tam
In reply to this post by Greg Tam
basically it will be like a ftp server but with a few modifications. this is more like an update content management system. the client will be "pushed" content packages and will then update the server on status/progress. the server will most likely keep track of all transactions in some type of database.

On Thu, Mar 13, 2008 at 11:15 AM, Greg Tam <[hidden email]> wrote:
I want to create a file server is Grizzly the correct framework to use?

The file server will allow connections from clients that will upload and download files that could be x MB in size.

Reply | Threaded
Open this post in threaded view
|

Re: newbie question

Erik Svensson-3
basically it will be like a ftp server but with a few modifications. this is more like an update content management system. the client will be "pushed" content packages and will then update the server on status/progress. the server will most likely keep track of all transactions in some type of database.

In that case grizzly can fill your needs.

cheers
/Erik

On Thu, Mar 13, 2008 at 11:15 AM, Greg Tam <[hidden email]> wrote:
I want to create a file server is Grizzly the correct framework to use?

The file server will allow connections from clients that will upload and download files that could be x MB in size.


Reply | Threaded
Open this post in threaded view
|

Re: newbie question

Jeanfrancois Arcand-2


Erik Svensson wrote:
>> basically it will be like a ftp server but with a few modifications.
>> this is more like an update content management system. the client will
>> be "pushed" content packages and will then update the server on
>> status/progress. the server will most likely keep track of all
>> transactions in some type of database.
>
> In that case grizzly can fill your needs.

Yes, and you might want to look at [1] as a started. The [2] has several
tutorial on the topic.

Feel free to ask question!

A+

-- Jeanfrancois

[1]http://weblogs.java.net/blog/jfarcand/archive/2008/03/vrrrrrooommm_je.html
[2]https://grizzly.dev.java.net/


>
> cheers
> /Erik
>
>> On Thu, Mar 13, 2008 at 11:15 AM, Greg Tam <[hidden email]
>> <mailto:[hidden email]>> wrote:
>>
>>     I want to create a file server is Grizzly the correct framework to
>>     use?
>>
>>     The file server will allow connections from clients that will
>>     upload and download files that could be x MB in size.
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: newbie question

Greg Tam
in the code from https://grizzly.dev.java.net/tutorials/client-ant-tutorial/index.html
while using java 1.6

it complains on line 5 - what kind of IOEvent should it be accepting? (Cannot instantiate the type IOEvent)
it complains on line 17 (The method getSelectionKey() is undefined for the type IOEvent)

1  connectorHandler.connect(new InetSocketAddress(host, port), new CallbackHandler()
2            {
3               public void onConnect(IOEvent e)
4                {
5                    SelectionKey k = e.attachment().getSelectionKey();
6                    System.out.println("CallbackHandler: On Connect...");
7                    try
8                    {
9                        connectorHandler.finishConnect(k);
10                    }
11                    catch (Exception ex)
12                    {
13                        System.err.println("Exception in Callback: "
14                               + ex.getMessage());
15                    }
16
17                    e.attachment().getSelectorHandler().register(k, SelectionKey.OP_READ);
18                }

On Thu, Mar 13, 2008 at 5:24 PM, Jeanfrancois Arcand <[hidden email]> wrote:


Erik Svensson wrote:
>> basically it will be like a ftp server but with a few modifications.
>> this is more like an update content management system. the client will
>> be "pushed" content packages and will then update the server on
>> status/progress. the server will most likely keep track of all
>> transactions in some type of database.
>
> In that case grizzly can fill your needs.

Yes, and you might want to look at [1] as a started. The [2] has several
tutorial on the topic.

Feel free to ask question!

A+

-- Jeanfrancois

[1]http://weblogs.java.net/blog/jfarcand/archive/2008/03/vrrrrrooommm_je.html
[2]https://grizzly.dev.java.net/


>
> cheers
> /Erik
>
>> On Thu, Mar 13, 2008 at 11:15 AM, Greg Tam <[hidden email]
>> <mailto:[hidden email]>> wrote:
>>
>>     I want to create a file server is Grizzly the correct framework to
>>     use?
>>
>>     The file server will allow connections from clients that will
>>     upload and download files that could be x MB in size.
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]




--
Cze-Jwin Gregory Tam
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: newbie question

Greg Tam
Nevermind
i just casted the e.attachment() to Context

On Fri, Mar 14, 2008 at 9:17 AM, Greg Tam <[hidden email]> wrote:
in the code from https://grizzly.dev.java.net/tutorials/client-ant-tutorial/index.html
while using java 1.6

it complains on line 5 - what kind of IOEvent should it be accepting? (Cannot instantiate the type IOEvent)
it complains on line 17 (The method getSelectionKey() is undefined for the type IOEvent)

1  connectorHandler.connect(new InetSocketAddress(host, port), new CallbackHandler()
2            {
3               public void onConnect(IOEvent e)
4                {
5                    SelectionKey k = e.attachment().getSelectionKey();
6                    System.out.println("CallbackHandler: On Connect...");
7                    try
8                    {
9                        connectorHandler.finishConnect(k);
10                    }
11                    catch (Exception ex)
12                    {
13                        System.err.println("Exception in Callback: "
14                               + ex.getMessage());
15                    }
16
17                    e.attachment().getSelectorHandler().register(k, SelectionKey.OP_READ);
18                }


On Thu, Mar 13, 2008 at 5:24 PM, Jeanfrancois Arcand <[hidden email]> wrote:


Erik Svensson wrote:
>> basically it will be like a ftp server but with a few modifications.
>> this is more like an update content management system. the client will
>> be "pushed" content packages and will then update the server on
>> status/progress. the server will most likely keep track of all
>> transactions in some type of database.
>
> In that case grizzly can fill your needs.

Yes, and you might want to look at [1] as a started. The [2] has several
tutorial on the topic.

Feel free to ask question!

A+

-- Jeanfrancois

[1]http://weblogs.java.net/blog/jfarcand/archive/2008/03/vrrrrrooommm_je.html
[2]https://grizzly.dev.java.net/


>
> cheers
> /Erik
>
>> On Thu, Mar 13, 2008 at 11:15 AM, Greg Tam <[hidden email]
>> <mailto:[hidden email]>> wrote:
>>
>>     I want to create a file server is Grizzly the correct framework to
>>     use?
>>
>>     The file server will allow connections from clients that will
>>     upload and download files that could be x MB in size.
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]




--
Cze-Jwin Gregory Tam
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: newbie question

Jeanfrancois Arcand-2
Hi,

Or just do:

public void onConnect(IOEvent<Context> e)

That's probably a typo...

Thanks!

-- Jeanfrancois

Greg Tam wrote:

> Nevermind
> i just casted the e.attachment() to Context
>
> On Fri, Mar 14, 2008 at 9:17 AM, Greg Tam <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     in the code from
>     https://grizzly.dev.java.net/tutorials/client-ant-tutorial/index.html
>     while using java 1.6
>
>     it complains on line 5 - what kind of IOEvent should it be
>     accepting? (Cannot instantiate the type IOEvent)
>     it complains on line 17 (The method getSelectionKey() is undefined
>     for the type IOEvent)
>
>     1  connectorHandler.connect(new InetSocketAddress(host, port), new
>     CallbackHandler()
>     2            {
>     3               public void onConnect(IOEvent e)
>     4                {
>     5                    SelectionKey k = e.attachment().getSelectionKey();
>     6                    System.out.println("CallbackHandler: On
>     Connect...");
>     7                    try
>     8                    {
>     9                        connectorHandler.finishConnect(k);
>     10                    }
>     11                    catch (Exception ex)
>     12                    {
>     13                        System.err.println("Exception in Callback: "
>     14                               + ex.getMessage());
>     15                    }
>     16
>     17                  
>     e.attachment().getSelectorHandler().register(k, SelectionKey.OP_READ);
>     18                }
>
>
>     On Thu, Mar 13, 2008 at 5:24 PM, Jeanfrancois Arcand
>     <[hidden email] <mailto:[hidden email]>>
>     wrote:
>
>
>
>         Erik Svensson wrote:
>          >> basically it will be like a ftp server but with a few
>         modifications.
>          >> this is more like an update content management system. the
>         client will
>          >> be "pushed" content packages and will then update the server on
>          >> status/progress. the server will most likely keep track of all
>          >> transactions in some type of database.
>          >
>          > In that case grizzly can fill your needs.
>
>         Yes, and you might want to look at [1] as a started. The [2] has
>         several
>         tutorial on the topic.
>
>         Feel free to ask question!
>
>         A+
>
>         -- Jeanfrancois
>
>         [1]http://weblogs.java.net/blog/jfarcand/archive/2008/03/vrrrrrooommm_je.html
>         [2]https://grizzly.dev.java.net/
>
>
>          >
>          > cheers
>          > /Erik
>          >
>          >> On Thu, Mar 13, 2008 at 11:15 AM, Greg Tam
>         <[hidden email] <mailto:[hidden email]>
>          >> <mailto:[hidden email] <mailto:[hidden email]>>>
>         wrote:
>          >>
>          >>     I want to create a file server is Grizzly the correct
>         framework to
>          >>     use?
>          >>
>          >>     The file server will allow connections from clients that
>         will
>          >>     upload and download files that could be x MB in size.
>          >>
>          >>
>          >
>
>         ---------------------------------------------------------------------
>         To unsubscribe, e-mail: [hidden email]
>         <mailto:[hidden email]>
>         For additional commands, e-mail: [hidden email]
>         <mailto:[hidden email]>
>
>
>
>
>     --
>     Cze-Jwin Gregory Tam
>     [hidden email] <mailto:[hidden email]>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: newbie question

Erik Svensson-3
> That's probably a typo...

Funnily enough it is but not kind you would think.
When I typed up the html I forgot to replace the '<' and '>' in  
onConnect(IOEvent<Context> e)
with &lt; and &gt; which the browser regards as tags. If you download  
the source it compiles but if
you do cut'n'paste from the browser it doesn't.

I include a fixed version.

Jeanfrancois, can you replace the version on the grizzly site with  
the one included in this mail?

cheers

/Erik


>
> Thanks!
>
> -- Jeanfrancois
>
> Greg Tam wrote:
>> Nevermind
>> i just casted the e.attachment() to Context
>> On Fri, Mar 14, 2008 at 9:17 AM, Greg Tam <[hidden email]  
>> <mailto:[hidden email]>> wrote:
>>     in the code from
>>     https://grizzly.dev.java.net/tutorials/client-ant-tutorial/ 
>> index.html
>>     while using java 1.6
>>     it complains on line 5 - what kind of IOEvent should it be
>>     accepting? (Cannot instantiate the type IOEvent)
>>     it complains on line 17 (The method getSelectionKey() is  
>> undefined
>>     for the type IOEvent)
>>     1  connectorHandler.connect(new InetSocketAddress(host, port),  
>> new
>>     CallbackHandler()
>>     2            {
>>     3               public void onConnect(IOEvent e)
>>     4                {
>>     5                    SelectionKey k = e.attachment
>> ().getSelectionKey();
>>     6                    System.out.println("CallbackHandler: On
>>     Connect...");
>>     7                    try
>>     8                    {
>>     9                        connectorHandler.finishConnect(k);
>>     10                    }
>>     11                    catch (Exception ex)
>>     12                    {
>>     13                        System.err.println("Exception in  
>> Callback: "
>>     14                               + ex.getMessage());
>>     15                    }
>>     16
>>     17                       e.attachment().getSelectorHandler
>> ().register(k, SelectionKey.OP_READ);
>>     18                }
>>     On Thu, Mar 13, 2008 at 5:24 PM, Jeanfrancois Arcand
>>     <[hidden email]  
>> <mailto:[hidden email]>>
>>     wrote:
>>         Erik Svensson wrote:
>>          >> basically it will be like a ftp server but with a few
>>         modifications.
>>          >> this is more like an update content management system.  
>> the
>>         client will
>>          >> be "pushed" content packages and will then update the  
>> server on
>>          >> status/progress. the server will most likely keep  
>> track of all
>>          >> transactions in some type of database.
>>          >
>>          > In that case grizzly can fill your needs.
>>         Yes, and you might want to look at [1] as a started. The  
>> [2] has
>>         several
>>         tutorial on the topic.
>>         Feel free to ask question!
>>         A+
>>         -- Jeanfrancois
>>         [1]http://weblogs.java.net/blog/jfarcand/archive/2008/03/ 
>> vrrrrrooommm_je.html
>>         [2]https://grizzly.dev.java.net/
>>          >
>>          > cheers
>>          > /Erik
>>          >
>>          >> On Thu, Mar 13, 2008 at 11:15 AM, Greg Tam
>>         <[hidden email] <mailto:[hidden email]>
>>          >> <mailto:[hidden email]  
>> <mailto:[hidden email]>>>
>>         wrote:
>>          >>
>>          >>     I want to create a file server is Grizzly the correct
>>         framework to
>>          >>     use?
>>          >>
>>          >>     The file server will allow connections from  
>> clients that
>>         will
>>          >>     upload and download files that could be x MB in size.
>>          >>
>>          >>
>>          >
>>          
>> ---------------------------------------------------------------------
>>         To unsubscribe, e-mail: users-
>> [hidden email]
>>         <mailto:[hidden email]>
>>         For additional commands, e-mail: users-
>> [hidden email]
>>         <mailto:[hidden email]>
>>     --     Cze-Jwin Gregory Tam
>>     [hidden email] <mailto:[hidden email]>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

ClientTutorial.zip (14K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: newbie question

Jeanfrancois Arcand-2


Erik Svensson wrote:

>> That's probably a typo...
>
> Funnily enough it is but not kind you would think.
> When I typed up the html I forgot to replace the '<' and '>' in
> onConnect(IOEvent<Context> e)
> with &lt; and &gt; which the browser regards as tags. If you download
> the source it compiles but if
> you do cut'n'paste from the browser it doesn't.
>
> I include a fixed version.
>
> Jeanfrancois, can you replace the version on the grizzly site with the
> one included in this mail?

Done!

-- Jeanfrancois

>
> cheers
>
> /Erik
>
>
>>
>> Thanks!
>>
>> -- Jeanfrancois
>>
>> Greg Tam wrote:
>>> Nevermind
>>> i just casted the e.attachment() to Context
>>> On Fri, Mar 14, 2008 at 9:17 AM, Greg Tam <[hidden email]
>>> <mailto:[hidden email]>> wrote:
>>>     in the code from
>>>    
>>> https://grizzly.dev.java.net/tutorials/client-ant-tutorial/index.html
>>>     while using java 1.6
>>>     it complains on line 5 - what kind of IOEvent should it be
>>>     accepting? (Cannot instantiate the type IOEvent)
>>>     it complains on line 17 (The method getSelectionKey() is undefined
>>>     for the type IOEvent)
>>>     1  connectorHandler.connect(new InetSocketAddress(host, port), new
>>>     CallbackHandler()
>>>     2            {
>>>     3               public void onConnect(IOEvent e)
>>>     4                {
>>>     5                    SelectionKey k =
>>> e.attachment().getSelectionKey();
>>>     6                    System.out.println("CallbackHandler: On
>>>     Connect...");
>>>     7                    try
>>>     8                    {
>>>     9                        connectorHandler.finishConnect(k);
>>>     10                    }
>>>     11                    catch (Exception ex)
>>>     12                    {
>>>     13                        System.err.println("Exception in
>>> Callback: "
>>>     14                               + ex.getMessage());
>>>     15                    }
>>>     16
>>>     17                      
>>> e.attachment().getSelectorHandler().register(k, SelectionKey.OP_READ);
>>>     18                }
>>>     On Thu, Mar 13, 2008 at 5:24 PM, Jeanfrancois Arcand
>>>     <[hidden email] <mailto:[hidden email]>>
>>>     wrote:
>>>         Erik Svensson wrote:
>>>          >> basically it will be like a ftp server but with a few
>>>         modifications.
>>>          >> this is more like an update content management system. the
>>>         client will
>>>          >> be "pushed" content packages and will then update the
>>> server on
>>>          >> status/progress. the server will most likely keep track
>>> of all
>>>          >> transactions in some type of database.
>>>          >
>>>          > In that case grizzly can fill your needs.
>>>         Yes, and you might want to look at [1] as a started. The [2] has
>>>         several
>>>         tutorial on the topic.
>>>         Feel free to ask question!
>>>         A+
>>>         -- Jeanfrancois
>>>        
>>> [1]http://weblogs.java.net/blog/jfarcand/archive/2008/03/vrrrrrooommm_je.html 
>>>
>>>         [2]https://grizzly.dev.java.net/
>>>          >
>>>          > cheers
>>>          > /Erik
>>>          >
>>>          >> On Thu, Mar 13, 2008 at 11:15 AM, Greg Tam
>>>         <[hidden email] <mailto:[hidden email]>
>>>          >> <mailto:[hidden email] <mailto:[hidden email]>>>
>>>         wrote:
>>>          >>
>>>          >>     I want to create a file server is Grizzly the correct
>>>         framework to
>>>          >>     use?
>>>          >>
>>>          >>     The file server will allow connections from clients that
>>>         will
>>>          >>     upload and download files that could be x MB in size.
>>>          >>
>>>          >>
>>>          >
>>>        
>>> ---------------------------------------------------------------------
>>>         To unsubscribe, e-mail: [hidden email]
>>>         <mailto:[hidden email]>
>>>         For additional commands, e-mail: [hidden email]
>>>         <mailto:[hidden email]>
>>>     --     Cze-Jwin Gregory Tam
>>>     [hidden email] <mailto:[hidden email]>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]