Author: norman
Date: Thu Sep 15 19:52:51 2011
New Revision: 1171244
URL: http://svn.apache.org/viewvc?rev=1171244&view=rev
Log:
Add file based queue implementation. See JAMS-1316
Added:
james/server/trunk/queue-file/ (with props)
james/server/trunk/queue-file/.classpath (with props)
james/server/trunk/queue-file/.project (with props)
james/server/trunk/queue-file/.settings/
james/server/trunk/queue-file/.settings/org.eclipse.core.resources.prefs
(with props)
james/server/trunk/queue-file/.settings/org.eclipse.jdt.core.prefs (with
props)
james/server/trunk/queue-file/.settings/org.eclipse.jdt.ui.prefs (with
props)
james/server/trunk/queue-file/.settings/org.eclipse.m2e.core.prefs (with
props)
james/server/trunk/queue-file/.settings/org.eclipse.pde.core.prefs (with
props)
james/server/trunk/queue-file/pom.xml (with props)
james/server/trunk/queue-file/src/
james/server/trunk/queue-file/src/main/
james/server/trunk/queue-file/src/main/java/
james/server/trunk/queue-file/src/main/java/org/
james/server/trunk/queue-file/src/main/java/org/apache/
james/server/trunk/queue-file/src/main/java/org/apache/james/
james/server/trunk/queue-file/src/main/java/org/apache/james/queue/
james/server/trunk/queue-file/src/main/java/org/apache/james/queue/file/
james/server/trunk/queue-file/src/main/java/org/apache/james/queue/file/FileMailQueue.java
(with props)
james/server/trunk/queue-file/src/main/java/org/apache/james/queue/file/FileMailQueueFactory.java
(with props)
Propchange: james/server/trunk/queue-file/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep 15 19:52:51 2011
@@ -0,0 +1 @@
+target
Added: james/server/trunk/queue-file/.classpath
URL:
http://svn.apache.org/viewvc/james/server/trunk/queue-file/.classpath?rev=1171244&view=auto
==============================================================================
--- james/server/trunk/queue-file/.classpath (added)
+++ james/server/trunk/queue-file/.classpath Thu Sep 15 19:52:51 2011
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes"
path="src/main/java"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con"
path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Propchange: james/server/trunk/queue-file/.classpath
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: james/server/trunk/queue-file/.project
URL:
http://svn.apache.org/viewvc/james/server/trunk/queue-file/.project?rev=1171244&view=auto
==============================================================================
--- james/server/trunk/queue-file/.project (added)
+++ james/server/trunk/queue-file/.project Thu Sep 15 19:52:51 2011
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>james-server-queue-file</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ </natures>
+</projectDescription>
Propchange: james/server/trunk/queue-file/.project
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: james/server/trunk/queue-file/.settings/org.eclipse.core.resources.prefs
URL:
http://svn.apache.org/viewvc/james/server/trunk/queue-file/.settings/org.eclipse.core.resources.prefs?rev=1171244&view=auto
==============================================================================
--- james/server/trunk/queue-file/.settings/org.eclipse.core.resources.prefs
(added)
+++ james/server/trunk/queue-file/.settings/org.eclipse.core.resources.prefs
Thu Sep 15 19:52:51 2011
@@ -0,0 +1,3 @@
+#Thu Sep 15 21:04:19 CEST 2011
+eclipse.preferences.version=1
+encoding//src/main/java=UTF-8
Propchange:
james/server/trunk/queue-file/.settings/org.eclipse.core.resources.prefs
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: james/server/trunk/queue-file/.settings/org.eclipse.jdt.core.prefs
URL:
http://svn.apache.org/viewvc/james/server/trunk/queue-file/.settings/org.eclipse.jdt.core.prefs?rev=1171244&view=auto
==============================================================================
--- james/server/trunk/queue-file/.settings/org.eclipse.jdt.core.prefs (added)
+++ james/server/trunk/queue-file/.settings/org.eclipse.jdt.core.prefs Thu Sep
15 19:52:51 2011
@@ -0,0 +1,278 @@
+#Thu Sep 15 21:09:37 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do
not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do
not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do
not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do
not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do
not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do
not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do
not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do
not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do
not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=300
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
Propchange: james/server/trunk/queue-file/.settings/org.eclipse.jdt.core.prefs
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: james/server/trunk/queue-file/.settings/org.eclipse.jdt.ui.prefs
URL:
http://svn.apache.org/viewvc/james/server/trunk/queue-file/.settings/org.eclipse.jdt.ui.prefs?rev=1171244&view=auto
==============================================================================
--- james/server/trunk/queue-file/.settings/org.eclipse.jdt.ui.prefs (added)
+++ james/server/trunk/queue-file/.settings/org.eclipse.jdt.ui.prefs Thu Sep 15
19:52:51 2011
@@ -0,0 +1,4 @@
+#Thu Sep 15 21:09:37 CEST 2011
+eclipse.preferences.version=1
+formatter_profile=_ASF
+formatter_settings_version=12
Propchange: james/server/trunk/queue-file/.settings/org.eclipse.jdt.ui.prefs
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: james/server/trunk/queue-file/.settings/org.eclipse.m2e.core.prefs
URL:
http://svn.apache.org/viewvc/james/server/trunk/queue-file/.settings/org.eclipse.m2e.core.prefs?rev=1171244&view=auto
==============================================================================
--- james/server/trunk/queue-file/.settings/org.eclipse.m2e.core.prefs (added)
+++ james/server/trunk/queue-file/.settings/org.eclipse.m2e.core.prefs Thu Sep
15 19:52:51 2011
@@ -0,0 +1,5 @@
+#Thu Sep 15 21:04:19 CEST 2011
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
Propchange: james/server/trunk/queue-file/.settings/org.eclipse.m2e.core.prefs
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: james/server/trunk/queue-file/.settings/org.eclipse.pde.core.prefs
URL:
http://svn.apache.org/viewvc/james/server/trunk/queue-file/.settings/org.eclipse.pde.core.prefs?rev=1171244&view=auto
==============================================================================
--- james/server/trunk/queue-file/.settings/org.eclipse.pde.core.prefs (added)
+++ james/server/trunk/queue-file/.settings/org.eclipse.pde.core.prefs Thu Sep
15 19:52:51 2011
@@ -0,0 +1,3 @@
+#Thu Sep 15 21:04:20 CEST 2011
+BUNDLE_ROOT_PATH=target/classes
+eclipse.preferences.version=1
Propchange: james/server/trunk/queue-file/.settings/org.eclipse.pde.core.prefs
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: james/server/trunk/queue-file/pom.xml
URL:
http://svn.apache.org/viewvc/james/server/trunk/queue-file/pom.xml?rev=1171244&view=auto
==============================================================================
--- james/server/trunk/queue-file/pom.xml (added)
+++ james/server/trunk/queue-file/pom.xml Thu Sep 15 19:52:51 2011
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="ISO-8859-15"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>james-server</artifactId>
+ <groupId>org.apache.james</groupId>
+ <version>3.0-beta4-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.james</groupId>
+ <artifactId>james-server-queue-file</artifactId>
+ <name>Apache James Server File Mail Queue</name>
+ <properties>
+ <!-- OSGI stuff -->
+ <james.osgi.export>
+ org.apache.james.queue.file.*
+ </james.osgi.export>
+ <james.osgi.import>
+ *
+ </james.osgi.import>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.james</groupId>
+ <artifactId>james-server-queue-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.james</groupId>
+ <artifactId>james-server-lifecycle-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.james</groupId>
+ <artifactId>james-server-filesystem-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.james</groupId>
+ <artifactId>james-server-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.james</groupId>
+ <artifactId>apache-mailet</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${javax.mail.groupId}</groupId>
+ <artifactId>${javax.mail.artifactId}</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-annotation_1.1_spec</artifactId>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+<!--
+Inherit configuration from parent pom.
+-->
+ <executions>
+ <execution>
+ <goals>
+ <goal>jar</goal>
+<!--
+Allow tests to be used by other modules.
+Parent pom build failure prevents inheritance.
+-->
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Propchange: james/server/trunk/queue-file/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
james/server/trunk/queue-file/src/main/java/org/apache/james/queue/file/FileMailQueue.java
URL:
http://svn.apache.org/viewvc/james/server/trunk/queue-file/src/main/java/org/apache/james/queue/file/FileMailQueue.java?rev=1171244&view=auto
==============================================================================
---
james/server/trunk/queue-file/src/main/java/org/apache/james/queue/file/FileMailQueue.java
(added)
+++
james/server/trunk/queue-file/src/main/java/org/apache/james/queue/file/FileMailQueue.java
Thu Sep 15 19:52:51 2011
@@ -0,0 +1,425 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+package org.apache.james.queue.file;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.Iterator;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.Executors;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+
+import javax.mail.MessagingException;
+import javax.mail.util.SharedFileInputStream;
+
+import org.apache.james.core.MimeMessageCopyOnWriteProxy;
+import org.apache.james.core.MimeMessageSource;
+import org.apache.james.lifecycle.api.Disposable;
+import org.apache.james.lifecycle.api.LifecycleUtil;
+import org.apache.james.queue.api.ManageableMailQueue;
+import org.apache.mailet.Mail;
+import org.slf4j.Logger;
+
+/**
+ * {@link ManageableMailQueue} implementation which use the fs to store {@link
Mail}'s
+ *
+ * TODO: Split emails in sub-directories to make it more efficient with huge
queues
+ *
+ *
+ */
+public class FileMailQueue implements ManageableMailQueue {
+
+ private ConcurrentHashMap<String, FileItem> keyMappings = new
ConcurrentHashMap<String, FileMailQueue.FileItem>();
+ private BlockingQueue<String> inmemoryQueue = new
LinkedBlockingQueue<String>();
+ private ScheduledExecutorService scheduler =
Executors.newSingleThreadScheduledExecutor();
+
+ private final String queuename;
+ private final File parentDir;
+ private String queueDirName;
+ private final Logger log;
+ private boolean sync;
+ private final static String MSG_EXTENSION = ".msg";
+ private final static String OBJECT_EXTENSION = ".obj";
+
+ public FileMailQueue(File parentDir, String queuename, boolean sync,
Logger log) throws IOException {
+ this.queuename = queuename;
+ this.parentDir = parentDir;
+ this.log = log;
+ this.sync = sync;
+ init();
+ }
+
+ private void init() throws IOException {
+ File queueDir = new File(parentDir, queuename);
+ queueDirName = queueDir.getAbsolutePath();
+
+ if (!queueDir.exists()) {
+ if (!queueDir.mkdirs()) {
+ throw new IOException("Unable to create queue directory " +
queueDir);
+ }
+ } else {
+ String[] files = queueDir.list(new FilenameFilter() {
+
+ @Override
+ public boolean accept(File dir, String name) {
+ if (name.endsWith(MSG_EXTENSION)) {
+ if (new File(dir, name.substring(0, name.length()
-MSG_EXTENSION.length()) + OBJECT_EXTENSION).exists()) {
+ return true;
+ }
+ }
+ return false;
+ }
+ });
+ for (int a = 0; a < files.length; a++) {
+ final String name = files[a];
+
+ int i = name.indexOf("-");
+ if ( i > -1) {
+ final String objectFilename = name.substring(0,
name.length() - MSG_EXTENSION.length()) + OBJECT_EXTENSION;
+ long next = Long.parseLong(name.substring(0,i));
+ final String key = name.substring(i +1, name.length() -
MSG_EXTENSION.length());
+ FileItem item = new FileItem(queueDirName + "/" +
objectFilename, queueDirName + "/" + name);
+ keyMappings.put(key, item);
+ if (next <= System.currentTimeMillis()) {
+
+ try {
+ inmemoryQueue.put(key);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new RuntimeException("Unable to init", e);
+ }
+ } else {
+
+ // Schedule a task which will put the mail in the
queue for processing after a given delay
+ scheduler.schedule(new Runnable() {
+
+ @Override
+ public void run() {
+ try {
+ inmemoryQueue.put(key);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new RuntimeException("Unable to
init", e);
+ }
+ }
+ }, next - System.currentTimeMillis(),
TimeUnit.MILLISECONDS);
+ }
+ }
+ }
+ }
+ }
+
+
+
+
+ @Override
+ public void enQueue(Mail mail, long delay, TimeUnit unit) throws
MailQueueException {
+ final String key = mail.getName();
+ FileOutputStream out = null;
+ FileOutputStream foout = null;
+ ObjectOutputStream oout = null;
+ try {
+ String name = getFileNameWithoutExtension(queueDirName, key,
unit.toMillis(delay));
+
+ final FileItem item = new FileItem(name + OBJECT_EXTENSION, name +
MSG_EXTENSION);
+
+ foout = new FileOutputStream(item.getObjectFile());
+ oout = new ObjectOutputStream(foout);
+ oout.writeObject(mail);
+ oout.flush();
+ if (sync) foout.getFD().sync();
+ out = new FileOutputStream(item.getMessageFile());
+ mail.getMessage().writeTo(out);
+ out.flush();
+ if (sync) out.getFD().sync();
+
+ keyMappings.put(key, item);
+
+ if (delay > 0) {
+ scheduler.schedule(new Runnable() {
+
+ @Override
+ public void run() {
+ try {
+ inmemoryQueue.put(key);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new RuntimeException("Unable to init", e);
+ }
+ }
+ }, delay, unit);
+
+ } else {
+ inmemoryQueue.put(key);
+ }
+ } catch (FileNotFoundException e) {
+ throw new MailQueueException("Unable to enqueue mail", e);
+ } catch (IOException e) {
+ throw new MailQueueException("Unable to enqueue mail", e);
+
+ } catch (MessagingException e) {
+ throw new MailQueueException("Unable to enqueue mail", e);
+ } catch (InterruptedException e) {
+ throw new MailQueueException("Unable to enqueue mail", e);
+
+ } finally {
+ if (out != null) {
+ try {
+ out.close();
+ } catch (IOException e) {
+ // ignore on close
+ }
+ }
+ if (oout != null) {
+ try {
+ oout.close();
+ } catch (IOException e) {
+ // ignore on close
+ }
+ }
+ if (foout != null) {
+ try {
+ foout.close();
+ } catch (IOException e) {
+ // ignore on close
+ }
+ }
+ }
+
+ }
+
+ private String getFileNameWithoutExtension(String parentdir, String name,
long delay) {
+ return parentdir + "/" + System.currentTimeMillis() + delay + "-" +
name;
+ }
+ @Override
+ public void enQueue(Mail mail) throws MailQueueException {
+ enQueue(mail, 0, TimeUnit.MILLISECONDS);
+ }
+
+ @Override
+ public MailQueueItem deQueue() throws MailQueueException {
+ try {
+ FileItem item = null;
+ String k = null;
+ while (item == null) {
+ k = inmemoryQueue.take();
+ item = keyMappings.get(k);
+ }
+ final String key = k;
+ ObjectInputStream oin = null;
+ try {
+ final File objectFile = new File(item.getObjectFile());
+ final File msgFile = new File(item.getMessageFile());
+ oin = new ObjectInputStream(new FileInputStream(objectFile));
+ final Mail mail = (Mail) oin.readObject();
+ mail.setMessage(new MimeMessageCopyOnWriteProxy(new
FileMimeMessageSource(msgFile)));
+ return new MailQueueItem() {
+
+ @Override
+ public Mail getMail() {
+ return mail;
+ }
+
+ @Override
+ public void done(boolean success) throws
MailQueueException {
+ if (!success) {
+ try {
+ inmemoryQueue.put(key);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new MailQueueException("Unable to
rollback", e);
+ }
+ } else {
+ keyMappings.remove(key);
+ if (!objectFile.delete()) {
+ if (log.isInfoEnabled()) {
+ log.info("Unable to delete file " +
objectFile);
+ }
+ }
+ if (!msgFile.delete()) {
+ if (log.isInfoEnabled()) {
+ log.info("Unable to delete file " +
msgFile);
+ } }
+ }
+
+ LifecycleUtil.dispose(mail);
+ }
+ };
+ } catch (FileNotFoundException e) {
+ throw new MailQueueException("Unable to dequeue", e);
+ } catch (IOException e) {
+ throw new MailQueueException("Unable to dequeue", e);
+ } catch (ClassNotFoundException e) {
+ throw new MailQueueException("Unable to dequeue", e);
+ } catch (MessagingException e) {
+ throw new MailQueueException("Unable to dequeue", e);
+
+ } finally {
+ if (oin != null) {
+ try {
+ oin.close();
+ } catch (IOException e) {
+ // ignore on close
+ }
+ }
+ }
+
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new MailQueueException("Unable to dequeue", e);
+ }
+ }
+
+ private final class FileMimeMessageSource extends MimeMessageSource
implements Disposable{
+
+ private File file;
+ private SharedFileInputStream in;
+
+ public FileMimeMessageSource(File file) throws IOException {
+ this.file = file;
+ this.in = new SharedFileInputStream(file);
+ }
+
+ @Override
+ public String getSourceId() {
+ return file.getAbsolutePath();
+ }
+
+ /**
+ * Get an input stream to retrieve the data stored in the temporary
file
+ *
+ * @return a <code>BufferedInputStream</code> containing the data
+ */
+ public InputStream getInputStream() throws IOException {
+ return in.newStream(0, -1);
+ }
+
+
+ @Override
+ public long getMessageSize() throws IOException {
+ return file.length();
+ }
+
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.james.core.MimeMessageSource#disposeSource()
+ */
+ public void dispose() {
+ try {
+ in.close();
+ } catch (IOException e) {
+ }
+
+ file = null;
+ }
+
+ }
+
+ /**
+ * Helper class which is used to reference the path to the object and msg
file
+ *
+ *
+ */
+ private final static class FileItem {
+ private String objectfile;
+ private String messagefile;
+
+ public FileItem(String objectfile, String messagefile) {
+ this.objectfile = objectfile;
+ this.messagefile = messagefile;
+ }
+
+
+ public String getObjectFile() {
+ return objectfile;
+ }
+
+ public String getMessageFile() {
+ return messagefile;
+ }
+
+ }
+ @Override
+ public long getSize() throws MailQueueException {
+ return keyMappings.size();
+ }
+
+ @Override
+ public long flush() throws MailQueueException {
+ Iterator<String> keys = keyMappings.keySet().iterator();
+ long i = 0;
+ while(keys.hasNext()) {
+ String key = keys.next();
+ if (inmemoryQueue.contains(key) == false) {
+ inmemoryQueue.add(key);
+ i++;
+ }
+ }
+ return i;
+ }
+
+ /**
+ * TODO: implement me
+ *
+ * @return
+ * @throws MailQueueException
+ */
+ @Override
+ public long clear() throws MailQueueException {
+ throw new MailQueueException("Not supported yet");
+ }
+
+ /**
+ * TODO: implement me
+ *
+ * @param type
+ * @param value
+ * @return
+ * @throws MailQueueException
+ */
+ @Override
+ public long remove(Type type, String value) throws MailQueueException {
+ throw new MailQueueException("Not supported yet");
+
+ }
+
+ /**
+ * TODO: implement me
+ *
+ * @return
+ * @throws MailQueueException
+ */
+ @Override
+ public MailQueueIterator browse() throws MailQueueException {
+ throw new MailQueueException("Not supported yet");
+ }
+
+}
Propchange:
james/server/trunk/queue-file/src/main/java/org/apache/james/queue/file/FileMailQueue.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
james/server/trunk/queue-file/src/main/java/org/apache/james/queue/file/FileMailQueueFactory.java
URL:
http://svn.apache.org/viewvc/james/server/trunk/queue-file/src/main/java/org/apache/james/queue/file/FileMailQueueFactory.java?rev=1171244&view=auto
==============================================================================
---
james/server/trunk/queue-file/src/main/java/org/apache/james/queue/file/FileMailQueueFactory.java
(added)
+++
james/server/trunk/queue-file/src/main/java/org/apache/james/queue/file/FileMailQueueFactory.java
Thu Sep 15 19:52:51 2011
@@ -0,0 +1,81 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+package org.apache.james.queue.file;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
+import org.apache.james.filesystem.api.FileSystem;
+import org.apache.james.lifecycle.api.LogEnabled;
+import org.apache.james.queue.api.MailQueue;
+import org.apache.james.queue.api.MailQueueFactory;
+import org.slf4j.Logger;
+
+/**
+ * {@link MailQueueFactory} implementation which returns {@link FileMailQueue}
instances
+ *
+ *
+ */
+public class FileMailQueueFactory implements MailQueueFactory, LogEnabled{
+
+ private Map<String, MailQueue> queues = new HashMap<String, MailQueue>();
+ private FileSystem fs;
+ private Logger log;
+ private boolean sync = true;
+
+ @Resource(name = "filesystem")
+ public void setFileSystem(FileSystem fs) {
+ this.fs = fs;
+ }
+ public void setSync(boolean sync) {
+ this.sync = sync;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
org.apache.james.queue.api.MailQueueFactory#getQueue(java.lang.String)
+ */
+ public MailQueue getQueue(String name) {
+ MailQueue queue = queues.get(name);
+ if (queue == null) {
+ synchronized (queues) {
+ try {
+ queue = new
FileMailQueue(fs.getFile("file://var/store/queue"), name, sync, log);
+ queues.put(name, queue);
+ } catch (IOException e) {
+ throw new RuntimeException("Unable to access queue " +
name, e);
+ }
+ }
+ }
+ return queue;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.apache.james.lifecycle.api.LogEnabled#setLog(org.slf4j.Logger)
+ */
+ public void setLog(Logger log) {
+ this.log = log;
+ }
+
+}
+
Propchange:
james/server/trunk/queue-file/src/main/java/org/apache/james/queue/file/FileMailQueueFactory.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]