Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#461] Capacity and increase/decrease policies
- Loading branch information
maeste
committed
Mar 30, 2016
1 parent
c783989
commit ab1d3b9
Showing
37 changed files
with
2,224 additions
and
19 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
core/src/main/java/org/ironjacamar/core/api/connectionmanager/pool/CapacityDecrementer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* IronJacamar, a Java EE Connector Architecture implementation | ||
* Copyright 2016, Red Hat Inc, and individual contributors | ||
* as indicated by the @author tags. See the copyright.txt file in the | ||
* distribution for a full listing of individual contributors. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the Eclipse Public License 1.0 as | ||
* published by the Free Software Foundation. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Eclipse | ||
* Public License for more details. | ||
* | ||
* You should have received a copy of the Eclipse Public License | ||
* along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
package org.ironjacamar.core.api.connectionmanager.pool; | ||
|
||
import org.ironjacamar.core.connectionmanager.listener.ConnectionListener; | ||
|
||
/** | ||
* The capacity decrementer policy | ||
* | ||
* @author <a href="mailto:jesper.pedersen@ironjacamar.org">Jesper Pedersen</a> | ||
*/ | ||
public interface CapacityDecrementer | ||
{ | ||
/** | ||
* Should the connection listener be destroyed | ||
* @param cl The connection listener | ||
* @param timeout The timeout watermark | ||
* @param currentSize The current pool size | ||
* @param minPoolSize The minimum pool size | ||
* @param destroyed The number of connection listeners destroyed during this call cycle | ||
* @return <code>True</code> if the connection listener should be destroyed; otherwise <code>false</code> | ||
*/ | ||
public boolean shouldDestroy(ConnectionListener cl, long timeout, int currentSize, int minPoolSize, int destroyed); | ||
} |
38 changes: 38 additions & 0 deletions
38
core/src/main/java/org/ironjacamar/core/api/connectionmanager/pool/CapacityIncrementer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* IronJacamar, a Java EE Connector Architecture implementation | ||
* Copyright 2016, Red Hat Inc, and individual contributors | ||
* as indicated by the @author tags. See the copyright.txt file in the | ||
* distribution for a full listing of individual contributors. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the Eclipse Public License 1.0 as | ||
* published by the Free Software Foundation. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Eclipse | ||
* Public License for more details. | ||
* | ||
* You should have received a copy of the Eclipse Public License | ||
* along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
package org.ironjacamar.core.api.connectionmanager.pool; | ||
|
||
/** | ||
* The capacity incrementer policy | ||
* | ||
* @author <a href="mailto:jesper.pedersen@ironjacamar.org">Jesper Pedersen</a> | ||
*/ | ||
public interface CapacityIncrementer | ||
{ | ||
/** | ||
* Should the connection listener be created | ||
* @param currentSize The current pool size | ||
* @param maxSize The maximum pool size | ||
* @param created The number of connection listeners created during this call cycle | ||
* @return <code>True</code> if a connection listener should be created; otherwise <code>false</code> | ||
*/ | ||
public boolean shouldCreate(int currentSize, int maxSize, int created); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
core/src/main/java/org/ironjacamar/core/connectionmanager/pool/Capacity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* IronJacamar, a Java EE Connector Architecture implementation | ||
* Copyright 2016, Red Hat Inc, and individual contributors | ||
* as indicated by the @author tags. See the copyright.txt file in the | ||
* distribution for a full listing of individual contributors. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the Eclipse Public License 1.0 as | ||
* published by the Free Software Foundation. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Eclipse | ||
* Public License for more details. | ||
* | ||
* You should have received a copy of the Eclipse Public License | ||
* along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
package org.ironjacamar.core.connectionmanager.pool; | ||
|
||
import org.ironjacamar.core.api.connectionmanager.pool.CapacityDecrementer; | ||
import org.ironjacamar.core.api.connectionmanager.pool.CapacityIncrementer; | ||
|
||
/** | ||
* The capacity policy | ||
* | ||
* @author <a href="mailto:jesper.pedersen@ironjacamar.org">Jesper Pedersen</a> | ||
*/ | ||
public interface Capacity | ||
{ | ||
/** | ||
* Get the incrementer policy | ||
* @return The policy; can be <code>null</code> for container default policy | ||
*/ | ||
public CapacityIncrementer getIncrementer(); | ||
|
||
/** | ||
* Get the decrementer policy | ||
* @return The policy; can be <code>null</code> for container default policy | ||
*/ | ||
public CapacityDecrementer getDecrementer(); | ||
} |
Oops, something went wrong.