Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implementation for chat system #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions blogracy-vuze/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#Mon May 14 11:48:20 CEST 2012
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
99 changes: 99 additions & 0 deletions blogracy-vuze/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Blogracy #

## Introduction ##

Blogracy is a simple peer-to-peer social networking system, built on top of Bittorrent.
Essentially Blogracy is composed by two main modules:

1. a Vuze plugin
2. a web application

This information regards the first module, the Vuze plugin.

### Getting Vuze ###

Vuze is not packaged for Maven right now. This may change in the future.
Right now, it is necessary to:

1. Download Vuze jar (and sources) from main Vuze site: http://dev.vuze.com/
A link which is working at the present time is:
http://sourceforge.net/projects/azureus/files/vuze/Vuze_4702/Vuze_4702.jar/download
2. In the same directory where the files have been downloaded, execute
the "mvn-install-vuze.sh" script.

### Compile ###

To compile the sub-project, it is sufficient to issue

```
mvn compile
```

in the sub-project folder. This compiles all the Java sources.
The classes, the resource files (those in src/resources) and the
configuration files (in src/config) are copied in the "target" folder.

The following command, instead, creates a JAR archive in the "target" folder,
including Vuze classes and all other dependencies.

```
mvn package
```

### Maven and the IDE ###

Maven pom files are simply a description of a project. Such description can
be easily interpreted by an IDE and can be used to build the project.

Suppose that Blogracy sources have been cloned to "~/src/blogracy/".
The first step, in the "~/src/blogracy/blogracy-vuze/" folder, is just:

```
mvn eclipse:eclipse
```

that updates the eclipse project with stuff coming from maven.
Repeat this step when something changes in the pom file.

Then, start Eclipse using blogracy as workspace:

```
eclipse -data ~/src/blogracy/
```

In Eclipse, choose "Import Existing Maven Project" from the "File" menu,
and indicate the "~/src/blogracy/blogracy-vuze/" folder.

Feel free to read more documentation regarding integrating Eclipse with
Maven. There is also an excellent plugin that can be installed in Eclipse.
We however found that this first project setup phase is easier this way.

With IntelliJ things mostly work out of the box.

## Run ##

Either run:

```
java -jar target/blogracy-vuze-1.0-SNAPSHOT-jar-with-dependencies.jar
```

or:

```
mvn exec:exec
```

We do not use GUI or SWT. Consequently we run the Vuze console version.
We do not depend from STW, as a consequence.

Alternatively, you can put the blogracy-vuze...jar file into the plugins folder
of Vuze, and start Vuze normally. This way, you may also need to start ActiveMQ
by hand, separately.

### Executing Blogracy inside the IDE ###

Use the information above to create the appropriate configuration in the IDE.
The Blogracy class implements a static "main" method for starting ActiveMQ,
Vuze and Blogracy-Vuze plugin.

Binary file not shown.
Binary file not shown.
Empty file.
2 changes: 2 additions & 0 deletions blogracy-vuze/mvn-install-vuze.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
mvn install:install-file -DgroupId=vuze -DartifactId=vuze -Dpackaging=jar -Dversion=4702 -DgeneratePom=true -Dfile=Vuze_4702.jar
3 changes: 3 additions & 0 deletions blogracy-vuze/plugins/azupdater/plugin.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugin.class=org.gudy.azureus2.update.UpdaterUpdateChecker;org.gudy.azureus2.update.UpdaterPatcher
plugin.name=Azureus Update Support;Azureus Updater Support Patcher
plugin.install_if_missing=yes
14 changes: 13 additions & 1 deletion blogracy-vuze/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@
<version>1.0-SNAPSHOT</version>
<name>blogracy-vuze</name>
<url>http://maven.apache.org</url>

<build>
<resources>
<resource>
<directory>src/main/plugins</directory>
<targetPath>../plugins/</targetPath>
</resource>
<resource>
<directory>src/main/java/net/blogracy/chat/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -23,7 +33,9 @@
<version>1.2.1</version>
<configuration>
<executable>java</executable>
<workingDirectory>target/</workingDirectory>
<arguments>
<argument>-Dazureus.config.path=.</argument>
<argument>-classpath</argument>
<classpath/>
<argument>net.blogracy.Blogracy</argument>
Expand Down Expand Up @@ -59,7 +71,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<version>4.9</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
9 changes: 9 additions & 0 deletions blogracy-vuze/src/main/java/net/blogracy/Blogracy.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
import javax.jms.Connection;
import javax.jms.ConnectionFactory;

import net.blogracy.chat.ChatManager;
import net.blogracy.logging.Logger;
import net.blogracy.services.ChatService;
import net.blogracy.services.DownloadService;
import net.blogracy.services.LookupService;
import net.blogracy.services.SeedService;
Expand All @@ -36,6 +38,8 @@ public class Blogracy implements Plugin {
private LookupService lookupService;
private SeedService seedService;
private DownloadService downloadService;
private ChatService chatService;
private ChatManager chatManager;

/*
* (non-Javadoc)
Expand All @@ -61,7 +65,12 @@ void createQueues(final PluginInterface plugin) {
lookupService = new LookupService(connection, plugin);
seedService = new SeedService(connection, plugin);
downloadService = new DownloadService(connection, plugin);

chatManager = new ChatManager();
chatManager.initialize(plugin);
chatService = new ChatService(connection,chatManager, plugin);
Logger.info("Blogracy Vuze plugin has started correctly");

} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
Expand Down
Loading