You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Release of v0.1.0-beta.6 adds bash scripts for GNU/Linux and FreeBSD for the CBrew and Native libraries.
Install script for CBrew and Native libraries.
Updated supporting documentation with instructions on how to install install the CBrew and Native libraries.
Added templates folder to cbrew main
Added freebsd installer script and updated root directory for clearer directory structure.
Added further organization from previous commit.
Update install-freebsd.sh
[maven-release-plugin] prepare release v0.1.0-beta.6
[maven-release-plugin] prepare for next development iteration
Set theme jekyll-theme-hacker
* Please note, the master branch is always live! The latest release is reflected on <code>master</code>.
16
-
* The branch <code>staged-for-release</code> reflects the newest updates to the library which will be officially released in the next release iteration. New contributors should make pull requests into <code>staged-for-release</code>.
* Please note, the master branch is always live! The latest stable release is reflected on <code>master</code>.
16
+
* The branch <code>staged-for-release</code> contains the most recent nightly builds and includes the newest features which will be added to the library to be officially released to Maven Central (after the current development iteration). New contributors should make pull requests into <code>staged-for-release</code>.
17
17
* To dive into the concurrency library's source code, please navigate [here](https://github.com/nealkumar/JBrew/tree/docpatch-010/concurrent). The README.md contains information on how to get started, and full documentation is available at [jbrew.org](https://jbrew.org/).
18
18
* Feedback is always welcome, and can be submitted to [support@jbrew.org](mailto:support@jbrew.org). Thank you!
19
19
20
+
# User Installation
21
+
Note that contributors or other users who wish to use the latest nightly build should follow the [Upstream Installation](#upstream-installation) guide.
1. Simply download the file "install.sh" above. FreeBSD users should use the file "install-freebsd.sh" instead.
24
+
2. At your desired java.library.path, run "install.sh" in the terminal, like so:
25
+
* <code>./install.sh</code> will install to the current directory, OR
26
+
* <code>./install.sh /path/to/java.library.path</code> will install to the directory specified.
27
+
3. You may be prompted to enter sudo password. Note that no text or cursor movement will appear on screen.
28
+
* <code>[sudo] password for user: </code> Enter your credentials, then hit <code>[Enter]</code>.
29
+
4. Your installation is complete! ***Important:*** Make sure you set your java.library.path to the location specied in part 2, appended with /bin (Ex: <code>java.library.path=/path/in-part2/bin)</code> before compiling your code, as these libraries have links to native libraries.
30
+
* Essentially, whenever you run the <code>java</code> command, you will need to add <code>-Djava.library.path=path/to/where-you-ran/install.sh/in-step-2/bin</code> (Don't forget to append "/bin" to the end of the location!). More detailed istructions can be found [here](https://examples.javacodegeeks.com/java-basics/java-library-path-what-is-it-and-how-to-use/). Just remember to append "/bin"!
31
+
* For Maven JUnit tests, it is reccomended you add the Apache Surefire plugin and provide the java.library.path as a compiler argument. [Use these instructions](https://stackoverflow.com/questions/10226082/surefire-junit-testing-using-native-libraries) if you are unsure how to do this.
20
32
# JBrew Maven Dependencies
21
-
<p>The following libraries are available as Maven depdendencies, which can be inserted into your project's <code>pom.xml</code>.</p>
33
+
<p>The following libraries are synchronixed with Maven Central, and can be inserted into your project's <code>pom.xml</code> as a dependency.</p>
22
34
23
35
## Concurrency Library
24
36
```xml
25
37
<dependencies>
26
38
<dependency>
27
39
<groupId>org.jbrew</groupId>
28
40
<artifactId>concurrent</artifactId>
29
-
<version>0.1.0-beta.5</version>
41
+
<version>0.1.0-beta.6</version>
30
42
</dependency>
31
43
</dependencies>
32
44
```
33
-
## CBrew JNI Library
45
+
## CBrew JNI Library (See [User Installation Guide](#user-installation) before using)
34
46
```xml
35
47
<dependencies>
36
48
<dependency>
37
-
<groupId>org.jbrew.native</groupId>
38
-
<artifactId>native-core</artifactId>
39
-
<version>0.1.0-beta.5</version>
49
+
<groupId>org.jbrew.cbrew</groupId>
50
+
<artifactId>cbrew</artifactId>
51
+
<version>0.1.0-beta.6</version>
40
52
</dependency>
41
53
</dependencies>
42
54
```
43
-
## CBrew Libary Validators
55
+
## CBrew Libary Validators (See [User Installation Guide](#user-installation) before using)
44
56
```xml
45
57
<dependencies>
46
58
<dependency>
47
-
<groupId>org.jbrew.native</groupId>
48
-
<artifactId>native-validators</artifactId>
49
-
<version>0.1.0-beta.5</version>
59
+
<groupId>org.jbrew.cbrew</groupId>
60
+
<artifactId>cbrew-validators</artifactId>
61
+
<version>0.1.0-beta.6</version>
50
62
</dependency>
51
63
</dependencies>
52
64
```
53
-
## Native Libary Validators
65
+
## Native Libary Validators (See [User Installation Guide](#user-installation) before using)
54
66
```xml
55
67
<dependencies>
56
68
<dependency>
57
69
<groupId>org.jbrew.native</groupId>
58
70
<artifactId>native-validators</artifactId>
59
-
<version>0.1.0-beta.5</version>
71
+
<version>0.1.0-beta.6</version>
60
72
</dependency>
61
73
</dependencies>
62
74
```
63
-
## Native Library Core
75
+
## Native Library Core (See [User Installation Guide](#user-installation) before using)
64
76
```xml
65
77
<dependencies>
66
78
<dependency>
67
79
<groupId>org.jbrew.native</groupId>
68
-
<artifactId>native-core</artifactId>
69
-
<version>0.1.0-beta.5</version>
80
+
<artifactId>native</artifactId>
81
+
<version>0.1.0-beta.6</version>
70
82
</dependency>
71
83
</dependencies>
72
84
```
@@ -76,7 +88,7 @@
76
88
<dependency>
77
89
<groupId>org.jbrew.core</groupId>
78
90
<artifactId>annotations</artifactId>
79
-
<version>0.1.0-beta.5</version>
91
+
<version>0.1.0-beta.6</version>
80
92
</dependency>
81
93
</dependencies>
82
94
```
@@ -86,15 +98,15 @@
86
98
<dependency>
87
99
<groupId>org.jbrew.core</groupId>
88
100
<artifactId>jbrew-core</artifactId>
89
-
<version>0.1.0-beta.5</version>
101
+
<version>0.1.0-beta.6</version>
90
102
</dependency>
91
103
</dependencies>
92
104
```
93
-
# Installation
94
-
To install the JBrew library locally, simple clone this libary from <code>master</code> or any other branch needed for development. Next, run "mvn package" at the project's
105
+
# Upstream Installation
106
+
To install the JBrew library locally, simple clone this libary from the branch <code>staged-for-release</code> to get the latest nightly build. Next, run "mvn package" at the project's
95
107
root directory. If you receive errors, please proceed to follow the installation steps below for your specific operating system.
96
-
## Linux
97
-
Linux is supported as the primary development for JBrew. As such, no additional configuration is needed for most Linux distros. JBrew is actively tested on the
108
+
## GNU/Linux
109
+
The GNU/Linux is supported as the primary development for JBrew. As such, no additional configuration is needed for most Linux distros. JBrew is actively tested on the
98
110
following Linux distrubtions:
99
111
* RHEL 8.1/8.2, CentOS, Fedora
100
112
* RHEL 7.0+
@@ -103,11 +115,97 @@ following Linux distrubtions:
103
115
* Ubuntu
104
116
## FreeBSD 12.1+
105
117
As of release v0.1.0-beta.4, FreeBSD is now supported as part of the CBrew and Native libraries! TO configure JBrew for BSD, simply update the <code>java.library.path</code>
106
-
from <code>$(user.home}/bin/</code> to <code>${user.home}/binbsd/</code>. The reason for this configuration is that by default, C executables are packaged for
118
+
from <code>$(user.home}/bin/</code> to <code>${user.home}/bin/freebsd/</code>. The reason for this configuration is that by default, C executables are packaged for
107
119
Linux systems. There are slight variances for FreeBSD systems which must be accounted for, and as such a seperate binaries folder was created to house all FreeBSD
108
120
C libraries for CBrew and Native.
109
121
## Windows 10+
110
122
As of release v0.1.0-beta.3, Windows 10+ is now supported as part of the CBrew and Native libraries! No additional configuration is needed, as windows dynamically
111
123
linked libraries are packaged as part of the standard release process.
112
-
## Solaris OS
113
-
At the moment, SolarisOS is <i>not</i> supported by JBrew. If you would like Solaris support, please open an issue detailing your request.
124
+
## Solaris
125
+
At the moment, SolarisOS is <i>not</i> supported by JBrew. If you would like Solaris support, please open an issue detailing your request.
126
+
# JBrew Java Concurrency Library
127
+
The Concurrent Tasks Library is an easy-to-consume Java concurrency library allowing for "Tasks" to execute business logic in a thread safe manner. This library helps users achieve multi-threading in their applications without worrying about synchronization and blocking for race conditions. Presently, there are 2 types of Tasks: Retrievable and Non-Retrievable.
128
+
<br/>
129
+
<i>Please note, the below content is relavent only for v0.0.1 - v0.0.4 of the JBrew concurrency library. For v0.0.5 and above, please refer to the official documentation at [jbrew.org](https://jbrew.org/). README documentation will be updated with the Release Candidate release of v0.1.0-rc.</i>
130
+
### Retrievable Tasks
131
+
Once <code>RetrievableTask</code> is extended, this allows for <code>@ThreadSafe</code> concurrent execution where business logic executed <i>does</i> need to return back an object. As a result, calling the getVal() method for a Retrievable task returns the object of type T (via use of Java generics) - which is blocked until all logic in the execute() method has terminated.
132
+
<br/><br/>
133
+
Example usages: Api calls, I/O, or any other situation warranting concurrent parallel processing.
134
+
<br/><br/>
135
+
Note that classes extending RetrievableTask.java should explicity specify object type in the class declaration to enable compile-type type checking. See example:
//then set the return value for ExampleTasks's object
149
+
this.obj ="Example task successfully completed";
150
+
}
151
+
}
152
+
```
153
+
### Non-Retrievable or Basic Tasks
154
+
Once <code>NonRetrievableTask</code> or <code>BasicTask</code> has been extended, this allows for simple concurrent execution where the business logic executed <i>does <b>not</b></i> need to return back an object. As a result, calling the getVal() method for a NonRetrievableTask throws an <code>java.lang.UnsupportedOperationException</code>.
155
+
</br></br>
156
+
Example usages: initializers, message dispatchers, or any standalone time-consuming task which you would like to execute concurrently.
157
+
# Client Usage Examples
158
+
Regardless on the type of <code>Task</code> needed, each respective <code>Task</code> should be wrapped within with a <code>Thread</code> and will begin execution upon calling of the <code>start()</code> or <code>run()</code> methods. The <code>start()</code> method executes the <code>Task</code> in a new thread, while the <code>run()</code> method executes the <code>Task</code> in the same thread.
159
+
<br/><br/>Below is an example of a <code>RetrievableTask</code> and <code>NonRetrievable</code> executing business logic in new threads, and then printing out status messages - based on the designated <code>Task</code> type.
160
+
```java
161
+
publicclassMain{
162
+
163
+
privateTask retrievable, nonRetrievable;
164
+
165
+
publicstaticvoidmain(String[] args){
166
+
retrieveable =newRTask();
167
+
nonRetrievable =newNRTask();
168
+
169
+
//start the Retrievable Task
170
+
Thread t =newThread(retrievable);
171
+
t.start();
172
+
//start the Non-Retrievable Task using an anonymous Thread
173
+
newThread(nonRetrievable).start();
174
+
175
+
//Print the results of each respective Task
176
+
System.out.println(retrievable.getVal()); // Since this is a RetrievableTask, retrievable.getVal()
177
+
// is blocked until its execute() method has completed.
0 commit comments